forum

Home / DeveloperSection / Forums / SQL call a SP from another SP

SQL call a SP from another SP

Anonymous User 2474 20-Jul-2013
HI developers!

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?


Updated on 20-Jul-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By