|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Today @ 3:19 PM
Points: 11,789,
Visits: 28,062
|
|
you'll notice that this is really a way to store multiple values in a single data field....it kind of goes against the grain of a relational database...one field=one value and all that, but logic like this is used in a lot of applications;
Lowell
--There is no spoon, and there's no default ORDER BY in sql server either. Actually, Common Sense is so rare, it should be considered a Superpower. --my son
|
|
|
|
|
SSC-Insane
         
Group: General Forum Members
Last Login: Today @ 12:56 PM
Points: 21,376,
Visits: 9,583
|
|
The explanation in books online wasn't clear enough, are you sure you read it??
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, April 23, 2013 12:55 AM
Points: 7,
Visits: 169
|
|
There are some databases showing as offline. But their status in sysdatabases are 4194840 and 528 (some are 4194840 and the others are 528)... Do anyone knows what are those and what are the different? Thanks in advance
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Today @ 3:19 PM
Points: 11,789,
Visits: 28,062
|
|
4194840 = TORN_PAGE_DETECTION,OFFLINE,AUTOSHRINK 528 = TORN_PAGE_DETECTION,OFFLINE my script from page one helps find the values, here's a snippet where i just plug in specific values:
declare @status int SET @status = 528 select @status as OriginalStatus, CASE WHEN (@status & 1) = 0 THEN 'FALSE' ELSE 'TRUE' END AS [AUTOCLOSE_(ALTER_DATABASE)], CASE WHEN (@status & 4) = 0 THEN 'FALSE' ELSE 'TRUE' END AS [SELECT_INTO/BULKCOPY_(ALTER_DATABASE_USING_SET_RECOVERY)], CASE WHEN (@status & 8) = 0 THEN 'FALSE' ELSE 'TRUE' END AS [TRUNC._LOG_ON_CHKPT_(ALTER_DATABASE_USING_SET_RECOVERY)], CASE WHEN (@status & 16) = 0 THEN 'FALSE' ELSE 'TRUE' END AS [TORN_PAGE_DETECTION_(ALTER_DATABASE)], CASE WHEN (@status & 32) = 0 THEN 'FALSE' ELSE 'TRUE' END AS [LOADING], CASE WHEN (@status & 64) = 0 THEN 'FALSE' ELSE 'TRUE' END AS [PRE_RECOVERY], CASE WHEN (@status & 128) = 0 THEN 'FALSE' ELSE 'TRUE' END AS [RECOVERING], CASE WHEN (@status & 256) = 0 THEN 'FALSE' ELSE 'TRUE' END AS [NOT_RECOVERED], CASE WHEN (@status & 512) = 0 THEN 'FALSE' ELSE 'TRUE' END AS [OFFLINE_(ALTER_DATABASE)], CASE WHEN (@status & 1024) = 0 THEN 'FALSE' ELSE 'TRUE' END AS [READ_ONLY_(ALTER_DATABASE)], CASE WHEN (@status & 2048) = 0 THEN 'FALSE' ELSE 'TRUE' END AS [DBO_USE_ONLY_(ALTER_DATABASE_USING_SET_RESTRICTED_USER)], CASE WHEN (@status & 4096) = 0 THEN 'FALSE' ELSE 'TRUE' END AS [SINGLE_USER_(ALTER_DATABASE)], CASE WHEN (@status & 32768) = 0 THEN 'FALSE' ELSE 'TRUE' END AS [EMERGENCY_MODE], CASE WHEN (@status & 4194304) = 0 THEN 'FALSE' ELSE 'TRUE' END AS [AUTOSHRINK_(ALTER_DATABASE)], CASE WHEN (@status &1073741824) = 0 THEN 'FALSE' ELSE 'TRUE' END AS [CLEANLY_SHUTDOWN]
eason36 (10/6/2008) There are some databases showing as offline. But their status in sysdatabases are 4194840 and 528 (some are 4194840 and the others are 528)... Do anyone knows what are those and what are the different? Thanks in advance
Lowell
--There is no spoon, and there's no default ORDER BY in sql server either. Actually, Common Sense is so rare, it should be considered a Superpower. --my son
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, April 23, 2013 12:55 AM
Points: 7,
Visits: 169
|
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 6:57 AM
Points: 15,
Visits: 76
|
|
| Excellent information !!! thank you all, this helped me understanding the status value clearly.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, February 21, 2013 4:34 AM
Points: 2,
Visits: 17
|
|
try out this function
select name from sysdatabases where name not in ('master','model','msdb','tempdb','pubs','Northwind') and DATABASEPROPERTYEX(name,'status')='ONLINE'
i got it from Hall of Fame (Rudy Komacsar Senior Database Administrator)
for more information read the following thread http://www.sqlservercentral.com/Forums/Topic371321-5-1.aspx
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, February 21, 2013 4:34 AM
Points: 2,
Visits: 17
|
|
|
|
|