Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass a variable to an SQL View

Status
Not open for further replies.

MikeT

IS-IT--Management
Feb 1, 2001
376
US
I need to pass a value from the query string to a View in a SQL 2000 Server. I believe I can do this adodb.command and the parameters collection.

However I'm not sure how to setup the View in SQL Server to accept parameters. Is that possible or do I have to use a stored procedure?
 
You cannot pass parameters to Views. Views have never in the past been able to contain parameters.
However user-defined functions can now be used like views, effectively allowing you to create parameterized views that return different results depending on the parameter values that get passed in each time the function is run. Unlike stored procedures (which also support parameters), these parameterized functions can be updateable.

so i would either go with UDF's or stored procedures.

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top