Trying to insert data into an sql server table using a variable as the table name
Has any body got any idea how I can use a variable as a table name when
trying to insert data into a table
My code uses VB to pass parameters to a SQL server 7 stored procedure which
will populate a table.
Basically all I need to know is how do you write the syntax.
CREATE PROCEDURE [INSERT_DATA]
@TABLENAME AS SYSNAME
INSERT INTO @TABLENAME
(NAME, ADDRESSS, DOB)
(@NAME, @ADDRESS, @DOB)
It will not recognize @TABLENAME as a valid table name.
Is it the syntax???
Any help at all would be great
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center