not4google
Programmer
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,
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,