Use SQL to filter the results of a stored procedure

Posted by Ben McCormack on Stack Overflow See other posts from Stack Overflow or by Ben McCormack
Published on 2010-04-02T14:29:32Z Indexed on 2010/04/02 14:33 UTC
Read the original article Hit count: 276

I've looked at other questions on Stack Overflow related to this question, but none of them seemed to answer this question clearly.

We have a system Stored Procedure called sp_who2 which returns a result set of information for all running processes on the server. I want to filter the data returned by the stored procedure; conceptually, I might do it like so:

SELECT * FROM sp_who2
WHERE login='bmccormack'

That method, though, doesn't work. What are good practices for achieving the goal of querying the returned data of a stored procedure, preferably without having to look of the code of the original stored procedure and modify it.

© Stack Overflow or respective owner

Related posts about sql

Related posts about t-sql