How to kill all connections in sql server from visual basic application ???

I tried to use SQLDMO from vb but it caused some errors is there any better solution for killing all connection sql server, I need to do it before database restore
Thanks
Pkrol1Asked:
Who is Participating?
 
leonstrykerConnect With a Mentor Commented:
Take a look at this:

http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_21088898.html

You can create this procedure and then execute it with ADO.

Leon
0
 
leonstrykerCommented:
What errors?

Leon
0
 
jdlambert1Commented:
You should run it from SQL Server, rather than SQLDMO, because it will try to kill SQLDMO's connection.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.