Re: SQLCMD output variables

Tech-Archive recommends: Fix windows errors by optimizing your registry



Mike McK (Mike McK@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
I am running stored procedures from the SQLCMD in SQL 2005. I have no
trouble passing in variables. How do I create and capture output
variables...not return codes from SQLCMD? Any thoughts?

Not really sure what you mean. You can do:

DECLARE @d int
EXEC some_sp @d int OUTPUT
SELECT @d

or are you thinking of something else?

--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.