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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable Question

Status
Not open for further replies.

not4google

Programmer
Nov 6, 2006
15
GB
Hi all,

I have a Stored Proc I am trying to optimise. Theres a select statement in there which puts a value into a variable which is then used further down in the SProcedure.

What I want to do is pre-run this stage so add a value to a variable and then be able to run the Stored Proc which uses this variable after the variable has been set.

From my understanding a local variable is only available in the batch, stored procedure or code block in which it is defined. Is there a way of presetting a variable and using this in the SP?

Thanks for any help,
 
There is, if you have the variable's desired value accessible to your application. This is really not an ANSI SQL problem though.

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top