• ericb1 (2/24/2012)


    This looks like what I've been trying to show on my SQL server, but I'm getting an error:

    Msg 102, Level 15, State 1, Line 17

    Incorrect syntax near '?'.

    Msg 137, Level 15, State 2, Line 35

    Must declare the scalar variable "@desSPID".

    I left the declare line commented out, assuming it would just return all processes? But that's not working. Tried adding "SET @desSPID = 2352" for my SQL process, but that gives the same error.

    Any help is greatly appreciated, thanks!

    Maybe put the declare line back in, but leave out anything with 'Set @desSPID = whatever' as this will then leave the declared variable @desSPID with value NULL thus returning all processes.