I have a little cursor function that provides a store procedure with an ID. The stored procedure only returns 1 varchar field.
What i want to do is something like:
FOR select top(500)
e.Thing_ID
from BPST_UI.dbo.Thingse
where e.Things_status_code = 'a'
DECLARE @Employee_ID INT
DECLARE @Text varchar(120)
.
.
. Some code
.
FETCH NEXT FROM Get_Local INTO @Thing_ID
WHILE (@@fetch_status <> -1)
BEGIN
IF (@@fetch_status <> -2)
BEGIN
SET @Text = exec [BPST_UI].dbo.sp_Get_Logical_Parent @Thing_ID /*This stores returns text*/
Select @Text,('Something else')as 'Other thing'
END
FETCH NEXT FROM Get_Local INTO @Employee_ID
END
... Can you assign the result to the variable @Text?
SET @Text = exec [BPST_UI].dbo.sp_Get_Logical_Parent @Thing_ID

New Topic/Question
Reply


MultiQuote





|