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 2000 Forums
 SQL Server Development (2000)
 Retreiving values in a Stored proc from a stored proc

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-10-09 : 08:00:29
David writes "How do I, is there a way to retreive the value from a stored procedure within another stored procedure.

I want a value created in one stored procedure to be used within another stored procedure.

Thanx in advance!"

dsdeming

479 Posts

Posted - 2003-10-09 : 08:27:01
Does the first procedure call the second one? Can't you just pass the value from the first procedure as a parameter to the second procedure?

Dennis
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2003-10-09 : 09:01:02
Something like:



USE Northwind
GO

CREATE PROC myProc2
@x datetime output
AS
SELECT @x = GetDate()
GO

CREATE PROC myProc
AS
DECLARE @x datetime
EXEC myProc2 @x OUTPUT
SELECT @x
GO

EXEC myProc
GO

Drop PROC myProc
GO
Drop PROC myProc2
GO


HTH...



Brett

8-)

SELECT @@POST FROM Brain ORDER BY NewId()

That's correct! It's an AlphaNumeric!
Go to Top of Page
   

- Advertisement -