Well guys i answered my own question:
The trick is to put the whole thing into one statement.
if anyone knows a better way, please post it ;)
declare @xxx varchar (5000)
declare @pTableName varchar (10)
declare @pNew varchar(6)
declare @pOld varchar(6)
declare @ID1 as varchar (6)
set @ID1 =...
Can I have an input paramater in a stored procedure be a table name?
If so, how do I use the paramater in the 'FOR' clause to set a cursor.
Example:
DECLARE curs CURSOR
FOR SELECT @pTableName WHERE ...
and so fourth?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.