Use SQL to filter the results of a stored procedure
- by Ben McCormack
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.