Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 305
  • Last Modified:

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
0
Pkrol1
Asked:
Pkrol1
  • 2
1 Solution
 
leonstrykerCommented:
What errors?

Leon
0
 
leonstrykerCommented:
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
 
jdlambert1Commented:
You should run it from SQL Server, rather than SQLDMO, because it will try to kill SQLDMO's connection.
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now