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
 Transact-SQL (2005)
 Output parameter questions

Author  Topic 

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2009-07-21 : 09:41:10
I have a few years program experience but I still do not understand how to use "output parameter" in program. For example, in ASP.NET.
Can some experts help me?
1) Why need output parameters?
2) Whe to use it?
3) How to use it?

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-07-21 : 09:46:43
Output parameters allow you to retrieve values from a stored procedure after the stored procedure finishes executing.
These values can be set and/or manipulated by the stored procedure.
Output parameters can be any data type.

-------------------------
R..
Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-07-21 : 09:51:33
[code]CREATE PROC SP1
@OUT OUTPUT
AS
BEGIN
SET @OUT=10
SELECT @OUT
END
GO
CREATE PROC SP2
AS
BEGIN
DECLARE @C INT
DECLARE @OUT INT

EXEC SP1 @OUT OUTPUT
SET @C = 10 * @OUT
SELECT @C

END[/code]

-------------------------
R..
Go to Top of Page
   

- Advertisement -