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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top