| | |
|
PowerASP active server pages asp.net microsoft .net framework sdk learn asp what is asp tutorial learn asp.net CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Stored procedure nightmare |
From: |
Tom Holder |
Date: |
2/6/2000 11:01:07 AM |
IP: |
193.149.90.244 |
Im trying to do something which I assume is very simple with a stored procedure. This is an example
pulled of the 4Guys web site to illustrate what I need to do:
CREATE PROCEDURE sp_myInsert
@FirstName varchar(20),
@LastName varchar(30),
@MyTableParam varchar(20)
As
INSERT INTO TableName(FirstName, LastName)
values(@FirstName, @LastName)
Go
Now this stored procedure is simple enough, even to me. However, rather than insert the values of
FirstName, and LastName into the table called TableName I need to insert them into the table
specified in the parameter @MyTableParam. I have tried doing the following (the obvious) but it
generates a syntax error.
CREATE PROCEDURE sp_myInsert
@FirstName varchar(20),
@LastName varchar(30),
@MyTableParam varchar(20)
As
INSERT INTO @MyTableParam(FirstName, LastName)
values(@FirstName, @LastName)
Go
Just out of interest, its actually a SELECT statement that I need to use this format in.
|
|
|

|
|
|
|