SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Controlling View's return dataset using "WHERE" C.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sriniathota
Starting Member

1 Posts

Posted - 12/30/2010 :  07:58:50  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

2937 Posts

Posted - 12/30/2010 :  09:14:55  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000