In SQL 2000 you can break all connections to a database and set your application as the only connection by using the TSQL statement "ALTER DATABASE <dbname> SET SINGLE_USER WITH ROLLBACK IMMEDIATE".
In SQL 7 you can get single user access using by using the TSQL statement "EXEC sp_dboption '<dbname>', 'single user', 'TRUE'". 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 "ALTER DATABASE <dbname> SET SINGLE_USER WITH ROLLBACK IMMEDIATE" in SQL 7?
Thanks,
Rob
In SQL 7 you can get single user access using by using the TSQL statement "EXEC sp_dboption '<dbname>', 'single user', 'TRUE'". 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 "ALTER DATABASE <dbname> SET SINGLE_USER WITH ROLLBACK IMMEDIATE" in SQL 7?
Thanks,
Rob