Thanks,
I use the codes below, but it fail when there are some users accessing
the database
------------------------------------------------------------------------------------------------------------------
C. Take a database offline
This example takes the sales database offline if there are no users
accessing the database.
USE master
EXEC sp_dboption 'sales', 'offline', 'TRUE'
"carion1" <
[email protected]>
¼¶¼g©ó¶l¥ó·s»D:uh%
[email protected]...
A better link for the offline part:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_da-di_8c32.asp
--
Derek Davis
(e-mail address removed)
If you are using SQL Server...
Take it offline:
http://developer.mimer.com/documentation/html_82/Mimer_SQL_Reference_Manual/SQL_Statements84.html
Restore it:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ra-rz_25rm.asp
--
Derek Davis
(e-mail address removed)
"Nicholas Paldino [.NET/C# MVP]" <
[email protected]>
wrote in message ad,
There is no way to do this out of the box. If anything, it
depends on the database. Most likely, you will have to use some sort
of administrative interface (there might or might not be one you can
access programatically, depending on the database) to kick everyone
off.
Which database are you using?
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
I write a restore program to restore a database.
But it must stop all connecions to the database before resotre.
How can I stop all connecions to the database by program?