Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

variable assignment and EXEC

Status
Not open for further replies.

Boucaner

Programmer
Sep 13, 2004
4
0
0
US
We have a SP that returns one column from one row. It is called from within another SP via EXEC. I am trying to assign the returned value to a variable, but the variable is always 0 (default for type).

exec @myVar = usp_my_sp @p1, @p2

A different table needs to be updated with the returned value. Any thoughts on how to get that value back, in a form that can then be used in an UPDATE statement?

By the way, the first SP uses dynamic SQL and EXEC (don't ask), so a nice, simple join is not available.

Thanks
 
I assume this is for SQL Server, so you really should post your question there.

This post thread183-1318473 may help you. Good luck.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Thanks gmmastros. I added an output param to the lowest level SP, and it worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top