whatsthehampton
Programmer
Hi,
I'd like to reuse some stored procedures and just pass a variable to them as the table name from code.
I've read up but cannot find the answer unfortunately.
Something like:
create PROCEDURE [dbo].[KB_GetIDByNodeText]
(
@NodeText nvarchar(50),
@xTable varchar (50)
)
AS
select id from
@xTable
where
NodeText=@NodeText
RETURN
I'm getting "Must declare the table variable "@xTable""
Thanks, j
I'd like to reuse some stored procedures and just pass a variable to them as the table name from code.
I've read up but cannot find the answer unfortunately.
Something like:
create PROCEDURE [dbo].[KB_GetIDByNodeText]
(
@NodeText nvarchar(50),
@xTable varchar (50)
)
AS
select id from
@xTable
where
NodeText=@NodeText
RETURN
I'm getting "Must declare the table variable "@xTable""
Thanks, j