How can I Disconnect all SQL SERVER 2000 active Conncetions using Delphi code or sql syntax?
Posted on 2007-10-16
I'm develpoing a module of an accounting application that needs to restore a backed up Database in SQL SERVER 2000 . I'm using Delphi to do this , I'e created a query to restore the Selected back up file , when I test my restore query in Query analyzer , it works correctly , but when I use it in delphi application using ADOQuery to execute , it raises an exception and messages , the database which I'm about to restore is in use .
Now I want to know how can I disconnect all the actve connections to the specific database in SQL server using Delphi code or a SQL syntax which is able to be used in my Delphi code .