Question: SQL Server Views

  • Thread starter Thread starter VB Programmer
  • Start date Start date
V

VB Programmer

In SQL Enterprise Manager I have a View that joins several subqueries/views.

Through ADO.NET...
1. How can I modify the WHERE clause in the subqueries/views? For example,
I hardcoded "WHERE CustomerId = 1". I want this to be dynamic, based on
user input.
2. Is it possible to fill a dataset or datareader with the results from the
main view? How can I do this, if it is possible.

Thanks!
 
Hi,

VB Programmer said:
In SQL Enterprise Manager I have a View that joins several subqueries/views.

Through ADO.NET...
1. How can I modify the WHERE clause in the subqueries/views? For example,
I hardcoded "WHERE CustomerId = 1". I want this to be dynamic, based on
user input.

You should consider using stored procedures instead of views.
2. Is it possible to fill a dataset or datareader with the results from the
main view? How can I do this, if it is possible.

What is "main view"?
 
Thanks. I will try stored procedures.

The "main view" is the main query that incorporates the join of several
other views.
 
VB Programmer said:
Thanks. I will try stored procedures.

The "main view" is the main query that incorporates the join of several
other views.

Ah, yes, you can select from view as you select from table.
 
Back
Top