Currently working with Oracle, but will also need a solution for MS SQL.
I have a GUI that allows users to generate SQL that will be executed on the database. This
What about opening a new connection to the database, login in as sysdba and sending a "ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE" command specifying the SID of the process you want to terminate.
To get the sessionID: select sid from v$mystat where rownum = 1
To get Serial#: select sid, serial# from v$session where sid = :SID
http://www.oracle-base.com/articles/misc/KillingOracleSessions.php
EDIT: WW idea for not Login as sysdba here: http://forums.oracle.com/forums/thread.jspa?threadID=620578