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
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL