How can you assign the results of stored procedure to a variable
Posted on 2003-03-07
I am trying to create a stored procedure which must return a recordset containing a single varchar output value that can be assigned to a variable in another sp I am calling it from. I have tried the following:
Create Procedure "sp_LPG_Format"
@NewValue varchar(40) = null OUTPUT
SET @NewValue = @INPUT1 + @INPUT2
I need to be able to call this from within another stored procedure and assign its output value to a variable, I have tried using
EXEC @a = sp_LPG_Format 'INPUT 1', 'INPUT 2'
but I get the following error:
Syntax error converting the varchar value 'XXXX' to a column of data type int.
I noticed that SQL Server 2000 has User-Defined Functions that may do what I want but I only have SQL Server 7.0
please help, its driving me up the wall ...