Is there a way to pass a WHERE clause to a stored procedure and use it in a
SELECT statement without using EXECUTE ('select statement' + where clause)?
Here is a sample of a stored procedure and the call to the stored procedure:
CREATE PROCEDURE spReturnData
AS
SELECT * FROM ##Temp
------ Call to the procedure -------------------------------
EXECUTE spReturnData 'WHERE ID = 2'
==========================================================
Is there a way to run the SELECT statement from the spReturnData procedure
without it having to be a wrap procedure? The following SELECT statement
does not work:
Thank you for your help,
Steve Sturgis