Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Controlling View's return dataset using "WHERE" C.

Author  Topic 

sriniathota
Starting Member

1 Post

Posted - 2010-12-30 : 07:58:50
There is a DB view (based on a big table which has say 100k rows+), which is accessible to end users via Excel or Visual Studio tools, after they have successfully made a connection to the corresponding Database within the same tools.

Is there a way using which we can JUST show the initial 1000 rows of the view return dataset as an initial DEFAULT. And then if the user does a query on the view using WHERE clause then he sees the expected no of rows (could now be more than 1000).

Basically, we want the landing screen (within the calling tools) to only show some 1000 rows at the first place instead of user to wait for couple of mins to see the whole data.

I was wondering if the there is some way where by the "WHERE" clause can be used somehow to control that view's return dataset, meaning...

1. On the first call, by default, the view will return say expected 1000 rows.
2. But, then a user can pass "something" in the "where clause", which would NOW return their expected result by "somehow" ignoring/skipping the default 1000 rows condition.

Please let me know if you could suggest any such special WHERE clause, specially incase you have come across such thing before!!. Thanks for your patience.

Sachin.Nand

2937 Posts

Posted - 2010-12-30 : 09:14:55
On the landing screen execute a query something like this

select top 1000 yourcolumns from yourtable order by somecolumn

and then while searching u can execute the query with the where clause.

PBUH

Go to Top of Page
   

- Advertisement -