Showing posts with label disconnect. Show all posts
Showing posts with label disconnect. Show all posts

Friday, February 17, 2012

delete open connection on database

Hi,
Does anyone know how i can disconnect an user who has a open session
on a database?
The reason is i'd like to restore a database in a job but the job
always fails because of users which have an open session.
Is there a stored procedure which i can use before i use mit "restore
database"-statement?
Thx 4 Help,
Look up the kill command in Books Online, though using this frequently will
make you a very unpopular person.
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backup files? Try MiniSQLBackup
"holzi" <holzi@.bluemail.ch> wrote in message
news:ded7aa56.0406282334.52797e51@.posting.google.c om...
> Hi,
> Does anyone know how i can disconnect an user who has a open session
> on a database?
> The reason is i'd like to restore a database in a job but the job
> always fails because of users which have an open session.
> Is there a stored procedure which i can use before i use mit "restore
> database"-statement?
> Thx 4 Help,
|||Look up the kill command in Books Online, though using this frequently will
make you a very unpopular person.
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backup files? Try MiniSQLBackup
"holzi" <holzi@.bluemail.ch> wrote in message
news:ded7aa56.0406282334.52797e51@.posting.google.c om...
> Hi,
> Does anyone know how i can disconnect an user who has a open session
> on a database?
> The reason is i'd like to restore a database in a job but the job
> always fails because of users which have an open session.
> Is there a stored procedure which i can use before i use mit "restore
> database"-statement?
> Thx 4 Help,
|||holzi,
Why not put it into single user mode during the restore?
i.e.
ALTER DATABASE mydb SET SINGLE_USER WITH ROLLBACK IMMEDIATE
go
RESTORE mydb...
go
ALTER DATABASE mydb SET MULTI_USER
go
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
holzi wrote:
> Hi,
> Does anyone know how i can disconnect an user who has a open session
> on a database?
> The reason is i'd like to restore a database in a job but the job
> always fails because of users which have an open session.
> Is there a stored procedure which i can use before i use mit "restore
> database"-statement?
> Thx 4 Help,
|||holzi,
Why not put it into single user mode during the restore?
i.e.
ALTER DATABASE mydb SET SINGLE_USER WITH ROLLBACK IMMEDIATE
go
RESTORE mydb...
go
ALTER DATABASE mydb SET MULTI_USER
go
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
holzi wrote:
> Hi,
> Does anyone know how i can disconnect an user who has a open session
> on a database?
> The reason is i'd like to restore a database in a job but the job
> always fails because of users which have an open session.
> Is there a stored procedure which i can use before i use mit "restore
> database"-statement?
> Thx 4 Help,

delete open connection on database

Hi,
Does anyone know how i can disconnect an user who has a open session
on a database?
The reason is i'd like to restore a database in a job but the job
always fails because of users which have an open session.
Is there a stored procedure which i can use before i use mit "restore
database"-statement?
Thx 4 Help,Look up the kill command in Books Online, though using this frequently will
make you a very unpopular person.
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backup files? Try MiniSQLBackup
"holzi" <holzi@.bluemail.ch> wrote in message
news:ded7aa56.0406282334.52797e51@.posting.google.com...
> Hi,
> Does anyone know how i can disconnect an user who has a open session
> on a database?
> The reason is i'd like to restore a database in a job but the job
> always fails because of users which have an open session.
> Is there a stored procedure which i can use before i use mit "restore
> database"-statement?
> Thx 4 Help,|||holzi,
Why not put it into single user mode during the restore?
i.e.
ALTER DATABASE mydb SET SINGLE_USER WITH ROLLBACK IMMEDIATE
go
RESTORE mydb...
go
ALTER DATABASE mydb SET MULTI_USER
go
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
holzi wrote:
> Hi,
> Does anyone know how i can disconnect an user who has a open session
> on a database?
> The reason is i'd like to restore a database in a job but the job
> always fails because of users which have an open session.
> Is there a stored procedure which i can use before i use mit "restore
> database"-statement?
> Thx 4 Help,

delete open connection on database

Hi,
Does anyone know how i can disconnect an user who has a open session
on a database?
The reason is i'd like to restore a database in a job but the job
always fails because of users which have an open session.
Is there a stored procedure which i can use before i use mit "restore
database"-statement?
Thx 4 Help,Look up the kill command in Books Online, though using this frequently will
make you a very unpopular person.
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backup files? Try MiniSQLBackup
"holzi" <holzi@.bluemail.ch> wrote in message
news:ded7aa56.0406282334.52797e51@.posting.google.com...
> Hi,
> Does anyone know how i can disconnect an user who has a open session
> on a database?
> The reason is i'd like to restore a database in a job but the job
> always fails because of users which have an open session.
> Is there a stored procedure which i can use before i use mit "restore
> database"-statement?
> Thx 4 Help,|||holzi,
Why not put it into single user mode during the restore?
i.e.
ALTER DATABASE mydb SET SINGLE_USER WITH ROLLBACK IMMEDIATE
go
RESTORE mydb...
go
ALTER DATABASE mydb SET MULTI_USER
go
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
holzi wrote:
> Hi,
> Does anyone know how i can disconnect an user who has a open session
> on a database?
> The reason is i'd like to restore a database in a job but the job
> always fails because of users which have an open session.
> Is there a stored procedure which i can use before i use mit "restore
> database"-statement?
> Thx 4 Help,