Script to kill all connections to a database

Whether you are restoring an EPDM Database or modified tables in
an existing EPDM Database, you are required to stop connections to the database
before continuing. Most of the time you can simply stop the SolidWorks
Enterprise PDM Archive and Database services and that should kill the
connections. However, sometimes this is not enough and this is where this
script comes in handy.

USE master

GO

ALTER DATABASE YourDatabaseName

SET OFFLINE WITH
ROLLBACK IMMEDIATE

GO

 

Leave a Reply