Results 1 to 2 of 2

Thread: Killing a login

  1. #1
    Join Date
    Dec 2002
    Location
    Los Angeles
    Posts
    11

    Killing a login

    I have a script that I use to see if someone has been logged in for too long. Does anyone know how to take a varible spid and kill that login. I tried using kill @spid, but that does not work. Any Suggestions?

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Try this:

    declare @t char(2)
    declare @c char(20)

    set @t = 55
    set @c = 'kill ' + @t
    exec (@c)

Posting Permissions

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