Output parameters can help in a number of ways. For the most part, they're
more efficient than returning a row containing values--the overhead in the
TDS stream is far lower and they give the developer more flexibility when
returning data to the client. Returning a dozen OUTPUT parameters is far
faster than returning a single row via a SELECT. Generally, OUTPUT
parameters are used whenever you want to return one or more values that are
not in a rowset like computed or @@ global values. In your SP you set the
OUTPUT argument on the parameter declaration and use a SELECT or SET
statement to set the value. On the client end, you create a Parameter object
whose direction is set to output. Remember that the OUTPUT parameter packets
are returned after any rowsets are returned.
hth
--
__________________________________________________ ________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
http://betav.com http://betav.com/blog/billva
__________________________________________________ __________________________________________
"aspfun via SQLMonster.com" <u53138@uwe> wrote
Quote:
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?
--
Message posted via http://www.sqlmonster.com |