Thursday, 9 June 2011

SQL:MAKE YOUR DATABASE OFFLINE/ONLINE

--SET YOUR DATABASE OFFLINE/ONLINE FOR DISPLAY --THIS COMMAND WILL HIDE --THE DATABASE FROM ALL USER
Setting a Database Offline/Online by using 3 way we can do.
Way 1.(By using Alter DataBase)
ALTER DATABASE SET OFFLINE
--Make ofline
ALTER DATABASE Test_Manoj SET OFFLINE
--Make online
ALTER DATABASE Test_Manoj SET OFFLINE

Way 2.(By using sp_dboptions)
--Set the Database Offline
sp_dboption database_name,'offline',true
--Set the Database Offline
sp_dboption database_name,'offline',false
Ex:-
sp_dboption Test_Manoj,'offline',true
Way 3.(By SQL Management Studio)
=>View Menu
=>Object Explorer
=>Right Click on Database
=>Task
=>Take Offline


Now , Your Database is in Offline Mode/Online Mode and enjoy the administrative command on SQL Server.

Posted By :javadevelopersguide
Follow Link-:http://javadevelopersguide.blogspot.com