Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameter reference (calling Sergey)
Message
From
05/08/2004 06:30:18
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Parameter reference (calling Sergey)
Miscellaneous
Thread ID:
00930922
Message ID:
00930922
Views:
74
I need to be able to dynamically reference a table name within an SQL stored procedure. For example:

CREATE Procedure ApplicationUserSelect1 @lnParam1 int, @lcTableName char
AS
set @lcTableName = 'V1System.dbo.ApplicationUser'
select a.* from #lcTableName a where a.User_ID = @lnParam1
GO

Firstly, I know this code doesn't work, this is purely for an example.

I'd like to be able to pass the Database.Table name into the procedure, as per the variable lcTableName, so that I can change the database location of the table from VFP (by simply passing it in to the SQL procedure).

Any ideas?

Regards

Derek
Next
Reply
Map
View

Click here to load this message in the networking platform