all groups > sql server odbc > june 2003 >
You're in the

sql server odbc

group:

assign EXEC() to a variable ?



assign EXEC() to a variable ? exBK
6/30/2003 2:22:47 PM
sql server odbc: Is it possible to capture the output of a EXEC() statement
into a variable ? I construct a dynamic sql which returns
a single value (SELECT count(*) from X) and I execute this
sql using EXEC. So is there anyway I can assign the count
(*) value to a local variable ? Or any other suggestions
Re: assign EXEC() to a variable ? Narayana Vyas Kondreddi
6/30/2003 11:44:33 PM
See if this helps:
http://support.microsoft.com/default.aspx?scid=kb;en-us;262499

--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
What hardware is your SQL Server running on?
http://vyaskn.tripod.com/poll.htm




[quoted text, click to view]
Is it possible to capture the output of a EXEC() statement
into a variable ? I construct a dynamic sql which returns
a single value (SELECT count(*) from X) and I execute this
sql using EXEC. So is there anyway I can assign the count
(*) value to a local variable ? Or any other suggestions
for this issue ? Thanks for your time."

AddThis Social Bookmark Button