all groups > sql server programming > november 2004 >
You're in the

sql server programming

group:

detach a db


detach a db jozzler
11/15/2004 10:53:01 PM
sql server programming: Hi
In a stored procedure I'm going to detach a db. Before doing that I will
make sure the operation will be successful. How can I make sure the database
Re: detach a db jozzler
11/15/2004 11:49:06 PM
How do I make these rows disappear?
// Jozzler

[quoted text, click to view]
Re: detach a db oj
11/16/2004 12:20:32 AM
You can force all connected users off by:

use master
go
alter database [your_db_name] set single_user with rollback immediate


[quoted text, click to view]

Re: detach a db jozzler
11/16/2004 5:53:04 AM
I have some trouble getting the kill-cmd into a stored procedure. Is kill-cmd
equal to delete the row in tbl sysprocesses?
// jozzler

[quoted text, click to view]
Re: detach a db avnrao
11/16/2004 12:36:21 PM
Select * from sysprocesses where dbid = db_id('master')
make sure that this doesnt return any rows.
Av.
http://dotnetjunkies.com/WebLog/avnrao
http://www28.brinkster.com/avdotnet

[quoted text, click to view]

Re: detach a db avnrao
11/16/2004 1:48:41 PM
you can use

Kill {spid} to kill all the processes for that database...

Av.
http://dotnetjunkies.com/WebLog/avnrao
http://www28.brinkster.com/avdotnet

[quoted text, click to view]

AddThis Social Bookmark Button