How do you get rid of users that are already in the database on the backup server when a restore starts?

Question

I’m trying to implement log shipping as described in your log shipping article, with a few slight modifications. The question I have is how do you get rid of users that are already in the database on the backup server when a restore starts? If someone is using the read-only capabilities when the restore starts, it will blow up. Setting it to single user mode will also fail if users are connected to the database.

Answer

SQL Server doesn’t include any built in way to kill all user connections to a database, so you must script this feature yourself.

If you don’t want to write your own script, you can do a Google search and find many variations on the Internet.




Related Articles :

  • No Related Articles Found

No comments yet... Be the first to leave a reply!

Software Reviews | Book Reviews | FAQs | Tips | Articles | Performance Tuning | Audit | BI | Clustering | Developer | Reporting | DBA | ASP.NET Ado | Views tips | | Developer FAQs | Replication Tips | OS Tips | Misc Tips | Index Tuning Tips | Hints Tips | High Availability Tips | Hardware Tips | ETL Tips | Components Tips | Configuration Tips | App Dev Tips | OLAP Tips | Admin Tips | Software Reviews | Error | Clustering FAQs | Performance Tuning FAQs | DBA FAQs |