SQL Server T-SQL - bring database online...?


  • Hi there, i would please like to know how to get a database online in T-SQL, I managed to get it offline in T-SQL, but know I can't get the database back online.

    Please help.

    If someone can please help me with the T-SQL command.

    Or direct me to a link where I can get more information.


    Wednesday, October 11, 2006 9:58 AM


All replies

  • You will not be able to start the server from Query Analyzer or from a program sending T-Sql commands. Starting the server requires an operating system command. You could use OSql and !! to force the shell command.

    Any other option would require the service to be started in order to respond to the command.

    Wednesday, October 11, 2006 11:07 AM
  • Hi, now the SQL Server isn't offline, it's only a database in SQL Server thats offline...

    SQl Server 2005 is still running, all I need to do is to bring that one specific db online again....

    I used

    USE db_name


    EXEC sp_dboption ''db_name, 'offline', 'TRUE'

    to take the db offline.... Now I need a command to bring the dabase back online.



    Wednesday, October 11, 2006 11:14 AM

    HTH, Jens K. Suessmeyer


    Wednesday, October 11, 2006 12:50 PM
  • Thanks
    Wednesday, October 11, 2006 12:55 PM