Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2012

    Unanswered: kill session from odbc connection

    Hi all,
    I'm developing an ODBC application written in C++ leveraging SQL Server 2014.

    I need to kill a session (I know the session id) from my ODBC connection.
    Is it possible?
    Do you have an example of code that I can try?


  2. #2
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    If you are an administrator on the SQL Server, then you can use the Transact-SQL KILL command. For instance, if you need to kill SQL Server spid 123 you could use the Transact-SQL command:
    KILL 123
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts