Home
Microsoft SQL Server
  - System tables
  - Procedure
    - Change Data Capture
    - Constraints
    - Files & folders
    - Fulltext (EFTS)
    - Index
    - Login & Users
    - OleDb
    - Oracle
    - Replication
    - Scripting
    - Server
    - Spatial geo
    - SQL Server Agent
    - Transaction
    - Trigger
    - XML
    - Uncategorized
  - Views
    - DMV
  - Functions
DigiMailing
Contact
The name of the object you are looking for
sysdbreg

A system table from the sys schema in master database. Exists in the master database only, contains a row for each registered database.
The column status2 was known as restat in MSSQL 2005. Cmptlevel is a new column which contains the compatibility level of the database in MSSQL 2008.

The values of status, restat and category are as described below.
Hexadecimal Binary Decimal master.sys.sysdbreg.status master.sys.sysdbreg.restat master.sys.sysdbreg.category
1 1 1 Is auto close on   is published
2 1 2     is subscribed
4 1 4   is date correlation on is merge published
8 1 8 *tempdb*    
10 1 16     is distributor
20 1 32 Restoring   is sync with backup
40 1 64   is master key encrypted by server  
80 1 128      
109 1 256 suspect    
200 1 512   is trustworthy on  
400 1 1.024 Readonly is db chaining on  
800 1 2.048   is numeric roundabort on  
1.000 1 4.096   is arithabort on  
2.000 1 8.192   is ansi padding on  
4.000 1 16.384   is ansi null default on  
8.000 1 32.768      
10.000 1 65.536 default modeldb is concat null yields null on  
20.000 1 131.072   is recursive triggers on  
40.000 1 262.144      
80.000 1 524.288      
100.000 1 1.048.576   is local cursor default  
200.000 1 2.097.152 Is in standby    
400.000 1 4.194.304 Is auto shrink on    
800.000 1 8.388.608 is read commited snapsot on is quoted identifier on  
1.000.000 1 16.777.216   is auto create stats on  
2.000.000 1 33.554.432   is cursor close on commit on  
4.000.000 1 67.108.864 Is cleanly shutdown is ansi nulls on  
8.000.000 1 134.217.728 is suplemental logging enabled is parameterization forced  
10.000.000 1 268.435.456   is ansi warnings on  
20.000.000 1 536.870.912   is fulltext enabled  
40.000.000 1 1.073.741.824   is auto update stats on  
80.000.000 1 2.147.483.648   is auto update stats async on  

So, update sys.sysdbreg set status=256 where name='<database_name>' marks the database as suspect. Another little trick is to place your own database among the system databases. Because Managment Studio looks at the system databases names and at the distributor option the only way is to mark your database as distributor with:
update sys.sysdbreg set category=16 where name='<database_name>'

The easiest way to to combine multiple database options is to sum the decimal. So a database with an status 1280 is suspect and readonly, like wise for the categorie. See also http://www.g-productions.nl/artikel.php?artikel=8

 

Create statement

CREATE TABLE master.sys.sysdbreg (
id int NULL,

name sysname NULL,
sid varbinary NULL,
status int NULL,
status2 int NULL,
category int NULL,
crdate datetime NULL,
modified datetime NULL,
svcbrkrguid uniqueidentifier NULL,
scope int NULL,
cmptlevel tinyint NULL)
GO
Refered by

Not operational yet...
System tables in the master database
MSSQL 2005
sysallocunits
sysasymkeys
sysbinobjs
sysbinsubobjs
syscerts
syschildinsts
sysclsobjs
syscolpars
sysconvgroup
sysdbfiles
sysdbreg
sysdercv
sysdesend
sysendpts
sysfiles1
sysftinds
sysguidrefs
syshobtcolumns
syshobts
sysidxstats
sysiscols
syslnklgns
syslogshippers
sysmultiobjrefs
sysnsobjs
sysobjkeycrypts
sysobjvalues
sysowners
sysprivs
sysqnames
sysremsvcbinds
sysrmtlgns
sysrowsetcolumns
sysrowsetrefs
sysrowsets
sysrts
sysscalartypes
sysschobjs
sysserefs
syssingleobjrefs
syssqlguides
systypedsubobjs
sysusermsgs
syswebmethods
sysxlgns
sysxmitqueue
sysxmlcomponent
sysxmlfacet
sysxmlplacement
sysxprops
sysxsrvs
MSSQL 2008
ALUCOUNT
sysallocunits
sysasymkeys
sysaudacts
sysbinobjs
sysbinsubobjs
sysbrickfiles
syscerts
syschildinsts
sysclsobjs
syscolpars
syscompfragments
sysconvgroup
sysdbfrag
sysdbreg
sysdercv
sysdesend
sysendpts
sysfgfrag
sysfiles1
sysftinds
sysftstops
sysguidrefs
sysidxstats
sysiscols
syslnklgns
syslogshippers
sysmultiobjrefs
sysnsobjs
sysobjkeycrypts
sysobjvalues
sysowners
syspalvalues
sysphfg
syspriorities
sysprivs
syspru
sysprufiles
sysqnames
sysremsvcbinds
sysrmtlgns
sysrowsetrefs
sysrowsets
sysrscols
sysrts
sysscalartypes
sysschobjs
syssingleobjrefs
syssoftobjrefs
syssqlguides
systypedsubobjs
sysusermsgs
syswebmethods
sysxlgns
sysxmitqueue
sysxmlcomponent
sysxmlfacet
sysxmlplacement
sysxprops
sysxsrvs
Nieuws

Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash