Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameterized views ins SQL Server???
Message
From
23/05/2003 11:38:57
Bruno Di Lalla
Bdl Computer Consulting
Greely, Ontario, Canada
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Parameterized views ins SQL Server???
Miscellaneous
Thread ID:
00792260
Message ID:
00792260
Views:
38
Hello everyone,

Using Visual Foxpro, I can create parameterized views such as:

CREATE TestView AS View ;
SELECT Client.Name ;
FROM Client ;
WHERE Client.City=?cCity

In the above example, cCity is a variable. I can then initialize the variable:
cCity="Ottawa"

then Select the query

SELECT * FROM TestView

The ?cCity parameter will have been replaced by the variable's content "Ottawa" and I will obtain all the Client names who's city is Ottawa.

Can something similar be done with Views in Microsoft SQL Server 2000 or is the only way to accomplish this is using a stored procedure?

Thanks for your expertise,


Bruno Di Lalla
Bruno Di Lalla
Consultant
BDL Computer Consulting
Next
Reply
Map
View

Click here to load this message in the networking platform