I have this code inside a stored procedure that inserts records into a table,
CREATE TABLE #Tmp (EmployeeID int)
EXECUTE ('INSERT INTO #Tmp ' + @Source)
However when the @Source is not a select statement, instead it is a stored proc returning records like the following
s122 (Param1, Param2)
I get an error message, "Incorrect syntax near 'proc_FilterOrientationNot
What is the easiest way to get this accomplished?