I have a sproc, which I can't modify the signature of, that has a SELECT statement as its last line:
SELECT userid = @userid
where @userid is declared inside the sproc (not passed in). Is there a way to capture the value of userid in a variable outside of the sproc?
If I want to capture two values by modifying the last line:
SELECT userid = @userid, somevar = @somevar
will that affect any existing code paths that are using this sproc (say calls being made in .NET)? If not, how do I capture two values outside of the sproc?
These captures will all be done in SQL, not an application language.