EXECUTING A STRING (HELP PLEASE!!)
i have a problem here that as much as i go through it looks worth.
I have build a dynamic query with a string like below:
CREATE PROCEDURE PROC1
DECLARE @TempQString nvarchar(1000)
SET @TempQString = 'DECLARE @resultvalue int'
SET @TempQString =@TempQString + 'EXEC @resultvalue=[MyStoredProcedure]'
EXEC sp_executesql @TempQString
now in the body of my main stored procedure (PROC1) i want to get the
return value if the [MyStoredProcedure] that was executed through a string!!!!!!!!!!
i've tried to insert the return value in a temp table (#table)
but this also didnt work, cuz out of the string execution my temp table was dropped!! also i cant use a global temp table (##table)
because many users may execute the PROC1 at the same time!!
PLEASE HELP THIS IS VERY IMPORTANT FOR ME
God Bless you,