Can I please have some help with the syntax of a SP in SQL.
Here is my code:
CREATE PROCEDURE usp_GetValue
(
@ID VARCHAR(10),
@Description VARCHAR(10)
)
AS
BEGIN
return @ID + @Description
END
CREATE PROCEDURE usp_InsertValue
(
@ID VARCHAR(10),
@FirstName VARCHAR(50),
@LastName VARCHAR(50),
@Description VARCHAR(10),
@Comment VARCHAR(max)
)
AS
BEGIN
Declare @v_Value VARCHAR(15)
Set @v_Value = usp_GetValue(@ID, @Description)
END
In the usp_InsertValue SP, I am wanting to declare and set a variable. Once the variable has been declared, I then wish to call another SP with parameters to set the value of the declared variable.
I am not sure of the syntax. May I please have some help?
shreesh chandra shukla
20-Jul-2013I think output parameters should be the proper way: See this post: stored procedure returns varchar