Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 how to use one SP value to another Sp Parameter

Author  Topic 

ssmani84
Starting Member

20 Posts

Posted - 2010-02-26 : 06:38:17
How can I use the output value of one stored procedure as the input value to another procedure?

ssmaniyadav

Kristen
Test

22859 Posts

Posted - 2010-02-26 : 08:17:05
[code]
CREATE PROCEDURE MySProc
@Param1 varchar(10),
@Param2 varchar(10),
@Param3 varchar(10) OUTPUT
AS
... some actions ...
SET @Param3 = 123
GO

-- Test:

DECLARE @MyParam varchar(10)

EXEC MySProc @Param1 ='ABC', @Param2 = 'DEF', @Param3 = @MyParam OUTPUT

SELECT @MyParam AS [MySProc output value for MyParam]
[/code]
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-26 : 08:29:49
http://www.sqlteam.com/article/stored-procedures-returning-data

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -