Results 1 to 5 of 5

Thread: Problem with kill statement

  1. #1
    Noel Guest

    Problem with kill statement

    Forgive me for what may be a dumb question but i`m having trouble using the kill statement in a stored procedure. The problem is that i always get a syntax error when using the kill statement with a local variable as the parameter.
    For example some part of the code is:
    declare @myspid smallint
    ...
    exec kill @myspid
    ...

    Please help!

  2. #2
    Noel Guest

    Problem with kill statement (reply)

    On 10/25/98 1:28:10 PM, Noel wrote:
    > Forgive me for what may be a dumb question but i`m having trouble using the
    > kill statement in a stored procedure. The problem is that i always get a
    > syntax error when using the kill statement with a local variable as the
    > parameter.
    I was really dumb after all, after searchin the documentation i`ve found the
    correct syntax.

  3. #3
    Join Date
    Jan 2009
    Posts
    2

    Question

    Mind telling us what that syntax you found was, please?

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    declare @id varchar(10), @cmd varchar(20)
    set @id = '51'
    set @cmd = 'kill ' + @id
    exec(@cmd)

  5. #5
    Join Date
    Jan 2009
    Posts
    2

    Thumbs up

    Thank you.

Posting Permissions

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