Aborting by program SQL process launch by this program

  •  

    HI

    I'M using VS2005 / VB.NET and SQL SERVER 2005. When I run very long process by running a stored procedures called in my application, I would like to have the possibility to abort and rollback this process.

    How can i obtain process ID of the process launch in my application in order to kill it ?

    Do exists an other way to do that ?

     

    Thanks in advance

  • sp_who2 is a simple way to see which processes are running. It shows the SPID. You can use that to kill a process.

    I'm not sure if this is the answer you're looking for, but if you wrapped your database call within a transaction on the VB side of the code, you could rollback the transaction from there.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply