Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can you break database connections in SQL7?

Status
Not open for further replies.

rcgold

Programmer
Mar 14, 2002
2
US
In SQL 2000 you can break all connections to a database and set your application as the only connection by using the TSQL statement &quot;ALTER DATABASE <dbname> SET SINGLE_USER WITH ROLLBACK IMMEDIATE&quot;.

In SQL 7 you can get single user access using by using the TSQL statement &quot;EXEC sp_dboption '<dbname>', 'single user', 'TRUE'&quot;. However, this statement fails if there is one or more open connections to the database.

Is there a way using SQL 7 TSQL to break all connections to a database?

Or, is there a better way to get the same behavior as the SQL 2000 &quot;ALTER DATABASE <dbname> SET SINGLE_USER WITH ROLLBACK IMMEDIATE&quot; in SQL 7?

Thanks,

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top