Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameterized sql stored proc.
Message
From
06/12/2002 14:55:45
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Parameterized sql stored proc.
Miscellaneous
Thread ID:
00730459
Message ID:
00730459
Views:
43
I'm trying this on SQL SERVER 7.0

CREATE PROCEDURE MYPROC
@MYTABLE_NAME VARCHAR(50),
@MYVALUE VARCHAR(10)
AS DELETE FROM @MYTABLE_NAME WHERE TABLE_FIELD = @MYVALUE

My intention is to create a stored procedure wich I can use to delete records from different tables depending on a parameter; but it seems that SQL does not accept a parameter as a valid expression for a table name.

SQL responds with an error message in line 3 saying: Error near @MYtable_name

Is there any way to get what I want?

TIA
There´s a better life... Just it´s more expensive!
Cristóbal Manrique M.
Next
Reply
Map
View

Click here to load this message in the networking platform