Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 status bit in sysdatabases

Author  Topic 

franco
Constraint Violating Yak Guru

255 Posts

Posted - 2002-09-26 : 04:35:49
I need to know the meaning of the status bit in sysdatabases because BOL only reports some of them.
For SQL 7.0 SP1 I have some database with a status bit equal to 0 (zero) and equal to 12.
For SQL 2000 SP2 I have some database with a status bit equal to 0 (zero),24,20 and 1073741840.
So I would really appreciate if someone can explain the meaning of these status bits.
Thank you very much.
Franco


nr
SQLTeam MVY

12543 Posts

Posted - 2002-09-26 : 06:39:56
Have you looked in Inside SQL Server?
Things like this are usually held in master..spt_values
for v7 sp2

DATABASE STATUS 0 D NULL NULL 0
autoclose 1 D NULL NULL 0
select into/bulkcopy 4 D NULL NULL 0
trunc. log on chkpt. 8 D NULL NULL 0
torn page detection 16 D NULL NULL 0
loading 32 D NULL NULL 0
pre recovery 64 D NULL NULL 0
recovering 128 D NULL NULL 0
not recovered 256 D NULL NULL 0
offline 512 D 0 1 0
read only 1024 D NULL NULL 0
dbo use only 2048 D NULL NULL 0
single user 4096 D NULL NULL 0
pending upgrade 16384 D NULL NULL 0
emergency mode 32768 D NULL NULL 0
missing files 262144 D NULL NULL 0
autoshrink 4194304 D NULL NULL 0
ALL SETTABLE OPTIONS 4218397 D NULL NULL 0
cleanly shutdown 1073741824 D NULL NULL 0


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2002-09-26 : 08:28:53
It's in BOL, look at the sysdatabases table, it decodes the status and status2 fields.


HTH
Jasper Smith
Go to Top of Page
   

- Advertisement -