Sysdatabases Status

  • HI,

    I have 2 databases with the following status in sysdatabases (4194320, 4194328). Where I can find the definition of these status?

    Thanks,

  • The BOL article on sysdatabases.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • see the thread here:http://www.sqlservercentral.com/Forums/Topic326235-5-2.aspxit's got a complete explanation on the flags., as well as a code snippet to plug in your status and get the results.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • In BOL; I do not found status value like 4194320, 4194328.

    What is the status of the database?

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

  • It goes like this..

    4194320 = 4194304 + 16

    4194304 = autoshrink

    16 = torn page detection

    4194328 = 4194304 + 16 + 8

    4194304 = autoshrink

    16 = torn page detection

    8 = trunc. log on chkpt

  • I use the bitwise and operator (&) to pull the status column apart for inspection.

    For example:

    SELECT

    name

    FROM

    master..sysdatabases

    WHERE

    name NOT IN ('tempdb')

    AND

    status & 512 <> 512

    512 means the database is offline. This query returns a list of database names where the database is online.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply