Click here to Skip to main content
15,893,594 members
Articles / Desktop Programming / Win32

SQL Class Shell Generator

Rate me:
Please Sign up or sign in to vote.
4.87/5 (65 votes)
8 Jan 2009CPOL6 min read 220K   3.3K   233  
Generate class shells from SQL Server database tables, (SQL 2005 & 2008 only). Output languages supported: C# and VB.NET.
��<HTML><HEAD>

<META NAME="COPYRIGHT" CONTENT="2008 � Paw Jershauge">

<META NAME="DESCRIPTION" CONTENT="This site contains information about the SQLReader  Class Library.">

<META NAME="AUTHOR" CONTENT="Paw Jershauge">

<META NAME="CODING" CONTENT="Paw Jershauge">

<META NAME="DEVELOPER" CONTENT="Paw Jershauge [http://paw.jershauge.dk]">

<META NAME="GENERATOR" CONTENT="Assembly To HTML by Paw Jershauge">

<LINK REL="STYLESHEET" TYPE="TEXT/CSS" HREF="../dat/msdn2.css"></LINK><SCRIPT LANGUAGE="Javascript1.2" SRC="../dat/jscr.js"></SCRIPT>

<TITLE>SQLReader by Paw Jershauge</TITLE></HEAD><BODY CLASS="typeenumeration" onload="wo('SQLReader.State_toolbar.htm','TOOLBAR')" onunload="wo('../toolbar.htm','TOOLBAR');CurrentObject('...');">

<P CLASS="medium"><IMG SRC="../img/minus.gif" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="midmgR" ID="collapse_expandimg" NAME="collapse_expandimg"><A NAME="collapse_expand" href="#collapse_expand" onclick="plusminustglcontentshowing();tglContent();" CLASS="liketext">Collapse/Expand content</A></P>

SQLReader  Class Library

<H1>State Enumeration</H1>

<P><B>Namespace:</B> <A HREF="SQLReader.htm">SQLReader</A></P>

<P><B>Assembly:</B> <A HREF="SQLReader(1.0.0.0).htm">SQLReader</A> ( in SQLReader.dll )</P>

<P><B>Basetype(s): </B><A HREF="http://msdn2.microsoft.com/en-us/library/System.Enum.aspx" TARGET="_blank">System.Enum</A></P>

<P><B>Inheritance(s): </B><A HREF="http://msdn2.microsoft.com/en-us/library/System.Int32.aspx" TARGET="_blank">System.Int32</A></P>

<P><A HREF="#" onclick="codetglsync();"><IMG SRC="../objimg/Folder_closed.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="midmgR">Show/Hide Code</A></P>

<H3>In this document the following highlight are available:</H3>

<UL><LI><A HREF="#ANAME_FieldBox">Fields (7)</A></LI><LI><A HREF="#ANAME_EnumItemsBox">Enum items (7)</A></LI><LI><A HREF="#ANAME_SeeAlso_RefBox">See also</A></LI></UL><A NAME="ANAME_EnumItemsBox"></A><H2 CLASS="clk" onclick="plusminustgl('EnumItemsBox');"><IMG SRC="../img/minus.gif" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="midmgR" ID="EnumItemsImg" NAME="EnumItemsBoxImg">Enum Items</H2>

<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%" ID="EnumItemsBox" NAME="EnumItemsBox"><TR><TD CLASS="tdhead">&nbsp;</TD><TD CLASS="tdhead">Name</TD><TD CLASS="tdhead">Type</TD><TD CLASS="tdhead">Value</TD><TD CLASS="tdhead">Description</TD></TR>

<TR><TD CLASS="tditemimg"><IMG SRC="../objimg/EnumItem.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Enumeration Item Field"></TD><TD CLASS="tditem">EMERGENCY</TD><TD CLASS="tditem"><A HREF="http://msdn2.microsoft.com/en-us/library/System.Int32.aspx" TARGET="_blank">Int32</A></TD><TD CLASS="tditem">5 <I>(0x00000005)</I></TD><TD CLASS="tditem">User has changed the database and set the status to EMERGENCY. The database is in single-user mode and may be repaired or restored. The database is marked READ_ONLY, logging is disabled, and access is limited to members of the sysadmin fixed server role. EMERGENCY is primarily used for troubleshooting purposes. For example, a database marked as suspect can be set to the EMERGENCY state. This could permit the system administrator read-only access to the database. Only members of the sysadmin fixed server role can set a database to the EMERGENCY state.&nbsp;</TD></TR>

<TR><TD CLASS="tditemimg"><IMG SRC="../objimg/EnumItem.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Enumeration Item Field"></TD><TD CLASS="tditem">OFFLINE</TD><TD CLASS="tditem"><A HREF="http://msdn2.microsoft.com/en-us/library/System.Int32.aspx" TARGET="_blank">Int32</A></TD><TD CLASS="tditem">6 <I>(0x00000006)</I></TD><TD CLASS="tditem">Database is unavailable. A database becomes offline by explicit user action and remains offline until additional user action is taken. For example, the database may be taken offline in order to move a file to a new disk. The database is then brought back online after the move has been completed.&nbsp;</TD></TR>

<TR><TD CLASS="tditemimg"><IMG SRC="../objimg/EnumItem.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Enumeration Item Field"></TD><TD CLASS="tditem">ONLINE</TD><TD CLASS="tditem"><A HREF="http://msdn2.microsoft.com/en-us/library/System.Int32.aspx" TARGET="_blank">Int32</A></TD><TD CLASS="tditem">0 <I>(0x00000000)</I></TD><TD CLASS="tditem">Database is available for access. The primary filegroup is online, although the undo phase of recovery may not have been completed.&nbsp;</TD></TR>

<TR><TD CLASS="tditemimg"><IMG SRC="../objimg/EnumItem.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Enumeration Item Field"></TD><TD CLASS="tditem">RECOVERING</TD><TD CLASS="tditem"><A HREF="http://msdn2.microsoft.com/en-us/library/System.Int32.aspx" TARGET="_blank">Int32</A></TD><TD CLASS="tditem">2 <I>(0x00000002)</I></TD><TD CLASS="tditem">Database is being recovered. The recovering process is a transient state; the database will automatically become online if the recovery succeeds. If the recovery fails, the database will become suspect. The database is unavailable.&nbsp;</TD></TR>

<TR><TD CLASS="tditemimg"><IMG SRC="../objimg/EnumItem.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Enumeration Item Field"></TD><TD CLASS="tditem">RECOVERY_PENDING</TD><TD CLASS="tditem"><A HREF="http://msdn2.microsoft.com/en-us/library/System.Int32.aspx" TARGET="_blank">Int32</A></TD><TD CLASS="tditem">3 <I>(0x00000003)</I></TD><TD CLASS="tditem">SQL Server has encountered a resource-related error during recovery. The database is not damaged, but files may be missing or system resource limitations may be preventing it from starting. The database is unavailable. Additional action by the user is required to resolve the error and let the recovery process be completed.&nbsp;</TD></TR>

<TR><TD CLASS="tditemimg"><IMG SRC="../objimg/EnumItem.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Enumeration Item Field"></TD><TD CLASS="tditem">RESTORING</TD><TD CLASS="tditem"><A HREF="http://msdn2.microsoft.com/en-us/library/System.Int32.aspx" TARGET="_blank">Int32</A></TD><TD CLASS="tditem">1 <I>(0x00000001)</I></TD><TD CLASS="tditem">One or more files of the primary filegroup are being restored, or one or more secondary files are being restored offline. The database is unavailable.&nbsp;</TD></TR>

<TR><TD CLASS="tditemimg"><IMG SRC="../objimg/EnumItem.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Enumeration Item Field"></TD><TD CLASS="tditem">SUSPECT</TD><TD CLASS="tditem"><A HREF="http://msdn2.microsoft.com/en-us/library/System.Int32.aspx" TARGET="_blank">Int32</A></TD><TD CLASS="tditem">4 <I>(0x00000004)</I></TD><TD CLASS="tditem">At least the primary filegroup is suspect and may be damaged. The database cannot be recovered during startup of SQL Server. The database is unavailable. Additional action by the user is required to resolve the problem.&nbsp;</TD></TR>

</TABLE>

<A NAME="ANAME_FieldBox"></A><H2 CLASS="clk" onclick="plusminustgl('FieldBox');"><IMG SRC="../img/minus.gif" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="midmgR" ID="FieldBoxImg" NAME="FieldBoxImg">Fields</H2>

<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%" ID="FieldBox" NAME="FieldBox"><TR><TD CLASS="tdhead">&nbsp;</TD><TD CLASS="tdhead">Name</TD><TD CLASS="tdhead">Type</TD><TD CLASS="tdhead">Description</TD></TR>

<TR><TD CLASS="tditemimg"><IMG SRC="../objimg/EnumItem.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Enumeration Item Field"><IMG SRC="../objimg/static.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Static"></TD><TD CLASS="tditem">EMERGENCY</TD><TD CLASS="tditem"><A HREF="SQLReader.State.htm" TARGET="_self">State</A></TD><TD CLASS="tditem">User has changed the database and set the status to EMERGENCY. The database is in single-user mode and may be repaired or restored. The database is marked READ_ONLY, logging is disabled, and access is limited to members of the sysadmin fixed server role. EMERGENCY is primarily used for troubleshooting purposes. For example, a database marked as suspect can be set to the EMERGENCY state. This could permit the system administrator read-only access to the database. Only members of the sysadmin fixed server role can set a database to the EMERGENCY state.&nbsp;</TD></TR>

<TR><TD CLASS="tditemimg"><IMG SRC="../objimg/EnumItem.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Enumeration Item Field"><IMG SRC="../objimg/static.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Static"></TD><TD CLASS="tditem">OFFLINE</TD><TD CLASS="tditem"><A HREF="SQLReader.State.htm" TARGET="_self">State</A></TD><TD CLASS="tditem">Database is unavailable. A database becomes offline by explicit user action and remains offline until additional user action is taken. For example, the database may be taken offline in order to move a file to a new disk. The database is then brought back online after the move has been completed.&nbsp;</TD></TR>

<TR><TD CLASS="tditemimg"><IMG SRC="../objimg/EnumItem.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Enumeration Item Field"><IMG SRC="../objimg/static.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Static"></TD><TD CLASS="tditem">ONLINE</TD><TD CLASS="tditem"><A HREF="SQLReader.State.htm" TARGET="_self">State</A></TD><TD CLASS="tditem">Database is available for access. The primary filegroup is online, although the undo phase of recovery may not have been completed.&nbsp;</TD></TR>

<TR><TD CLASS="tditemimg"><IMG SRC="../objimg/EnumItem.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Enumeration Item Field"><IMG SRC="../objimg/static.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Static"></TD><TD CLASS="tditem">RECOVERING</TD><TD CLASS="tditem"><A HREF="SQLReader.State.htm" TARGET="_self">State</A></TD><TD CLASS="tditem">Database is being recovered. The recovering process is a transient state; the database will automatically become online if the recovery succeeds. If the recovery fails, the database will become suspect. The database is unavailable.&nbsp;</TD></TR>

<TR><TD CLASS="tditemimg"><IMG SRC="../objimg/EnumItem.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Enumeration Item Field"><IMG SRC="../objimg/static.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Static"></TD><TD CLASS="tditem">RECOVERY_PENDING</TD><TD CLASS="tditem"><A HREF="SQLReader.State.htm" TARGET="_self">State</A></TD><TD CLASS="tditem">SQL Server has encountered a resource-related error during recovery. The database is not damaged, but files may be missing or system resource limitations may be preventing it from starting. The database is unavailable. Additional action by the user is required to resolve the error and let the recovery process be completed.&nbsp;</TD></TR>

<TR><TD CLASS="tditemimg"><IMG SRC="../objimg/EnumItem.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Enumeration Item Field"><IMG SRC="../objimg/static.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Static"></TD><TD CLASS="tditem">RESTORING</TD><TD CLASS="tditem"><A HREF="SQLReader.State.htm" TARGET="_self">State</A></TD><TD CLASS="tditem">One or more files of the primary filegroup are being restored, or one or more secondary files are being restored offline. The database is unavailable.&nbsp;</TD></TR>

<TR><TD CLASS="tditemimg"><IMG SRC="../objimg/EnumItem.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Enumeration Item Field"><IMG SRC="../objimg/static.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="mid" TITLE="Static"></TD><TD CLASS="tditem">SUSPECT</TD><TD CLASS="tditem"><A HREF="SQLReader.State.htm" TARGET="_self">State</A></TD><TD CLASS="tditem">At least the primary filegroup is suspect and may be damaged. The database cannot be recovered during startup of SQL Server. The database is unavailable. Additional action by the user is required to resolve the problem.&nbsp;</TD></TR>

</TABLE>

<H2>CodeDom of State Enumeration</H2>

<BR>

<IMG SRC="../objimg/Folder_closed.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="midmgR" ID="cscodeimg" NAME="cscodeimg"><A NAME="bookcscode" href="#bookcscode" onclick="codetgl('cscode');" CLASS="codetoggle">C# (CSharp) code</a>

<DIV NAME="cscode" ID="cscode" STYLE="display:none;">

<PRE CLASS="code">

<FONT COLOR="darkgreen">//C# (CSharp)</FONT>

public enum State : int {

    

    // Hex value is: 00000000

    [Description("Database is available for access. The primary filegroup is online, although the u" +

        "ndo phase of recovery may not have been completed.")]

    ONLINE = 0,

    

    // Hex value is: 00000001

    [Description("One or more files of the primary filegroup are being restored, or one or more sec" +

        "ondary files are being restored offline. The database is unavailable.")]

    RESTORING = 1,

    

    // Hex value is: 00000002

    [Description("Database is being recovered. The recovering process is a transient state; the dat" +

        "abase will automatically become online if the recovery succeeds. If the recovery" +

        " fails, the database will become suspect. The database is unavailable.")]

    RECOVERING = 2,

    

    // Hex value is: 00000003

    [Description(@"SQL Server has encountered a resource-related error during recovery. The database is not damaged, but files may be missing or system resource limitations may be preventing it from starting. The database is unavailable. Additional action by the user is required to resolve the error and let the recovery process be completed.")]

    RECOVERY_PENDING = 3,

    

    // Hex value is: 00000004

    [Description("At least the primary filegroup is suspect and may be damaged. The database cannot" +

        " be recovered during startup of SQL Server. The database is unavailable. Additio" +

        "nal action by the user is required to resolve the problem.")]

    SUSPECT = 4,

    

    // Hex value is: 00000005

    [Description(@"User has changed the database and set the status to EMERGENCY. The database is in single-user mode and may be repaired or restored. The database is marked READ_ONLY, logging is disabled, and access is limited to members of the sysadmin fixed server role. EMERGENCY is primarily used for troubleshooting purposes. For example, a database marked as suspect can be set to the EMERGENCY state. This could permit the system administrator read-only access to the database. Only members of the sysadmin fixed server role can set a database to the EMERGENCY state.")]

    EMERGENCY = 5,

    

    // Hex value is: 00000006

    [Description(@"Database is unavailable. A database becomes offline by explicit user action and remains offline until additional user action is taken. For example, the database may be taken offline in order to move a file to a new disk. The database is then brought back online after the move has been completed.")]

    OFFLINE = 6,

}

</PRE>

</DIV>

<BR><BR>

<IMG SRC="../objimg/Folder_closed.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="midmgR" ID="vbcodeimg" NAME="vbcodeimg"><A NAME="bookvbcode" href="#bookvbcode" onclick="codetgl('vbcode');" CLASS="codetoggle">VB (Visual Basic) code</a>

<DIV NAME="vbcode" ID="vbcode" STYLE="display:none;">

<PRE CLASS="code">

<FONT COLOR="darkgreen">'VB (Visual Basic)</FONT>

Public Enum State As Integer

    

    'Hex value is: 00000000

    &lt;Description("Database is available for access. The primary filegroup is online, although the u"& _ 

        "ndo phase of recovery may not have been completed.")&gt;  _

    ONLINE = 0

    

    'Hex value is: 00000001

    &lt;Description("One or more files of the primary filegroup are being restored, or one or more sec"& _ 

        "ondary files are being restored offline. The database is unavailable.")&gt;  _

    RESTORING = 1

    

    'Hex value is: 00000002

    &lt;Description("Database is being recovered. The recovering process is a transient state; the dat"& _ 

        "abase will automatically become online if the recovery succeeds. If the recovery"& _ 

        " fails, the database will become suspect. The database is unavailable.")&gt;  _

    RECOVERING = 2

    

    'Hex value is: 00000003

    &lt;Description("SQL Server has encountered a resource-related error during recovery. The database"& _ 

        " is not damaged, but files may be missing or system resource limitations may be "& _ 

        "preventing it from starting. The database is unavailable. Additional action by t"& _ 

        "he user is required to resolve the error and let the recovery process be complet"& _ 

        "ed.")&gt;  _

    RECOVERY_PENDING = 3

    

    'Hex value is: 00000004

    &lt;Description("At least the primary filegroup is suspect and may be damaged. The database cannot"& _ 

        " be recovered during startup of SQL Server. The database is unavailable. Additio"& _ 

        "nal action by the user is required to resolve the problem.")&gt;  _

    SUSPECT = 4

    

    'Hex value is: 00000005

    &lt;Description("User has changed the database and set the status to EMERGENCY. The database is in"& _ 

        " single-user mode and may be repaired or restored. The database is marked READ_O"& _ 

        "NLY, logging is disabled, and access is limited to members of the sysadmin fixed"& _ 

        " server role. EMERGENCY is primarily used for troubleshooting purposes. For exam"& _ 

        "ple, a database marked as suspect can be set to the EMERGENCY state. This could "& _ 

        "permit the system administrator read-only access to the database. Only members o"& _ 

        "f the sysadmin fixed server role can set a database to the EMERGENCY state.")&gt;  _

    EMERGENCY = 5

    

    'Hex value is: 00000006

    &lt;Description("Database is unavailable. A database becomes offline by explicit user action and r"& _ 

        "emains offline until additional user action is taken. For example, the database "& _ 

        "may be taken offline in order to move a file to a new disk. The database is then"& _ 

        " brought back online after the move has been completed.")&gt;  _

    OFFLINE = 6

End Enum

</PRE>

</DIV>

<BR><BR>

<IMG SRC="../objimg/Folder_closed.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="midmgR" ID="vjscodeimg" NAME="vjscodeimg"><A NAME="bookvjscode" href="#bookvjscode" onclick="codetgl('vjscode');" CLASS="codetoggle">VJ (Visual JSharp) code</a>

<DIV NAME="vjscode" ID="vjscode" STYLE="display:none;">

<PRE CLASS="code">

<FONT COLOR="darkgreen">//J# (Visual J#)</FONT>

public enum State {

    

    // Hex value is: 00000000

    /** @attribute Description("Database is available for access. The primary filegroup is online, although the u" +

"ndo phase of recovery may not have been completed.")*/

    ONLINE(0),

    

    // Hex value is: 00000001

    /** @attribute Description("One or more files of the primary filegroup are being restored, or one or more sec" +

"ondary files are being restored offline. The database is unavailable.")*/

    RESTORING(1),

    

    // Hex value is: 00000002

    /** @attribute Description("Database is being recovered. The recovering process is a transient state; the dat" +

"abase will automatically become online if the recovery succeeds. If the recovery" +

" fails, the database will become suspect. The database is unavailable.")*/

    RECOVERING(2),

    

    // Hex value is: 00000003

    /** @attribute Description("SQL Server has encountered a resource-related error during recovery. The database" +

" is not damaged, but files may be missing or system resource limitations may be " +

"preventing it from starting. The database is unavailable. Additional action by t" +

"he user is required to resolve the error and let the recovery process be complet" +

"ed.")*/

    RECOVERY_PENDING(3),

    

    // Hex value is: 00000004

    /** @attribute Description("At least the primary filegroup is suspect and may be damaged. The database cannot" +

" be recovered during startup of SQL Server. The database is unavailable. Additio" +

"nal action by the user is required to resolve the problem.")*/

    SUSPECT(4),

    

    // Hex value is: 00000005

    /** @attribute Description("User has changed the database and set the status to EMERGENCY. The database is in" +

" single-user mode and may be repaired or restored. The database is marked READ_O" +

"NLY, logging is disabled, and access is limited to members of the sysadmin fixed" +

" server role. EMERGENCY is primarily used for troubleshooting purposes. For exam" +

"ple, a database marked as suspect can be set to the EMERGENCY state. This could " +

"permit the system administrator read-only access to the database. Only members o" +

"f the sysadmin fixed server role can set a database to the EMERGENCY state.")*/

    EMERGENCY(5),

    

    // Hex value is: 00000006

    /** @attribute Description("Database is unavailable. A database becomes offline by explicit user action and r" +

"emains offline until additional user action is taken. For example, the database " +

"may be taken offline in order to move a file to a new disk. The database is then" +

" brought back online after the move has been completed.")*/

    OFFLINE(6)

}

</PRE>

</DIV>

<BR><BR>

<IMG SRC="../objimg/Folder_closed.png" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="midmgR" ID="vccodeimg" NAME="vccodeimg"><A NAME="bookvccode" href="#bookvccode" onclick="codetgl('vccode');" CLASS="codetoggle">VC (Visual C) code</a>

<DIV NAME="vccode" ID="vccode" STYLE="display:none;">

<PRE CLASS="code">

<FONT COLOR="darkgreen">//VC (Visual C)</FONT>

public enum class State sealed : System::Int32 {

    

    // Hex value is: 00000000

    [Description(L"Database is available for access. The primary filegroup is online, although the u" 

L"ndo phase of recovery may not have been completed.")]

    ONLINE = 0,

    

    // Hex value is: 00000001

    [Description(L"One or more files of the primary filegroup are being restored, or one or more sec" 

L"ondary files are being restored offline. The database is unavailable.")]

    RESTORING = 1,

    

    // Hex value is: 00000002

    [Description(L"Database is being recovered. The recovering process is a transient state; the dat" 

L"abase will automatically become online if the recovery succeeds. If the recovery" 

L" fails, the database will become suspect. The database is unavailable.")]

    RECOVERING = 2,

    

    // Hex value is: 00000003

    [Description(L"SQL Server has encountered a resource-related error during recovery. The database" 

L" is not damaged, but files may be missing or system resource limitations may be " 

L"preventing it from starting. The database is unavailable. Additional action by t" 

L"he user is required to resolve the error and let the recovery process be complet" 

L"ed.")]

    RECOVERY_PENDING = 3,

    

    // Hex value is: 00000004

    [Description(L"At least the primary filegroup is suspect and may be damaged. The database cannot" 

L" be recovered during startup of SQL Server. The database is unavailable. Additio" 

L"nal action by the user is required to resolve the problem.")]

    SUSPECT = 4,

    

    // Hex value is: 00000005

    [Description(L"User has changed the database and set the status to EMERGENCY. The database is in" 

L" single-user mode and may be repaired or restored. The database is marked READ_O" 

L"NLY, logging is disabled, and access is limited to members of the sysadmin fixed" 

L" server role. EMERGENCY is primarily used for troubleshooting purposes. For exam" 

L"ple, a database marked as suspect can be set to the EMERGENCY state. This could " 

L"permit the system administrator read-only access to the database. Only members o" 

L"f the sysadmin fixed server role can set a database to the EMERGENCY state.")]

    EMERGENCY = 5,

    

    // Hex value is: 00000006

    [Description(L"Database is unavailable. A database becomes offline by explicit user action and r" 

L"emains offline until additional user action is taken. For example, the database " 

L"may be taken offline in order to move a file to a new disk. The database is then" 

L" brought back online after the move has been completed.")]

    OFFLINE = 6,

};

</PRE>

</DIV>

<H2 CLASS="clk" onclick="plusminustgl('SeeAlso_RefBox');"><IMG SRC="../img/minus.gif" WIDTH="16" HEIGHT="16" BORDER="0" CLASS="midmgR" ID="SeeAlso_RefBoxImg" NAME="SeeAlso_RefBoxImg">See Also:</H2>

<A NAME="ANAME_SeeAlso_RefBox"></A><DIV ID="SeeAlso_RefBox" NAME="SeeAlso_RefBox">

&bull; <A HREF="http://msdn2.microsoft.com/en-us/library/System.Enum.aspx" TARGET="_blank">System.Enum</A>

&bull; <A HREF="http://msdn2.microsoft.com/en-us/library/System.Int32.aspx" TARGET="_blank">System.Int32</A>



</DIV>

<SCRIPT LANGUAGE="Javascript1.2">

parent.MENU.ShDiv('SQLReader(1.0.0.0)_Assembly');

parent.MENU.ShDiv('SQLReader.SQLReader_Namespace');

parent.MENU.ShDiv('SQLReader.SQLReader_Enumeration');

parent.MENU.location=parent.MENU.location + '#SQLReader_SQLReader.State';

CopyRight('Copyright � Paw Jershauge 2008');

CurrentObject('State Enumeration');

</SCRIPT>

</BODY></HTML>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Denmark Denmark

Comments and Discussions