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

    Question

  • 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.

    Thanks

    Wednesday, October 11, 2006 9:58 AM

Answers

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

    GO

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

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

     

    Thanks

    Wednesday, October 11, 2006 11:14 AM
  • ALTER DATABASE <Name> SET ONLINE

    HTH, Jens K. Suessmeyer

    ---
    http://www.sqlserver2005.de
    ---

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