G
Guest
Hi,
Environment = .NET 1.1, & ADO.NET, MS Sql
I am trying to create a database and populate it with data. If there are no
errors, then it works well. How ever, if there are any errors, I want to drop
the database.
To drop the database I use the sql command 'Drop Database MyDatabaseName'.
I run this command on a connection to the master Database on the Sql Server
I get an error returned which is ' Can not drop database as it is still in
use'. If I use the SQL Server Management tools, I need to 'Force all active
connections to close' before I can delete the database.
How can I do this in TSql code?
Thanks
Peter Tewkesbury
Environment = .NET 1.1, & ADO.NET, MS Sql
I am trying to create a database and populate it with data. If there are no
errors, then it works well. How ever, if there are any errors, I want to drop
the database.
To drop the database I use the sql command 'Drop Database MyDatabaseName'.
I run this command on a connection to the master Database on the Sql Server
I get an error returned which is ' Can not drop database as it is still in
use'. If I use the SQL Server Management tools, I need to 'Force all active
connections to close' before I can delete the database.
How can I do this in TSql code?
Thanks
Peter Tewkesbury