kurupt_89
kurupt_89

Reputation: 1592

Filtering Data from sql server

I have a web page that returns over 36000 items from sql server and I need ideas to filter the data. So far my ideas are paging through letters and a text search box which uses the following sql -

    select          O_ObjectID, 
                rtrim(O_Name) as O_Name
    from            A_Object
    where           O_Name like @NamePrefix + '%' OR O_Name like '% ' + @NamePrefix + '%'
    order by        O_Name

So any thoughts in which I can filter data?

Upvotes: 0

Views: 461

Answers (2)

Filburt
Filburt

Reputation: 18082

With a possible resultset of up to 36000 rows, paging won't help you much because no user is willing to browse more than 3 pages of search results - Honestly: Did you ever bother to click through more that 5 pages of Google search results before refining your search term?

Try to identify columns that would make up good filter criteria (besides O_Name), create a search form and limit the result to TOP 300.

Of course if your table actually only consists of O_ObjectID and O_Name you pretty much stuck with "Starts with" and "Contains" from your sample query ... you could add "Ends with" just to be complete.

Upvotes: 1

Chains
Chains

Reputation: 13157

Paging in classic asp -- it's been a while. It helps if you've got some read-only table to work from -- gets a little tricky if people can delete records from your table.

Anyway, here is a decent attempt: https://web.archive.org/web/20210506081930/http://www.4guysfromrolla.com/webtech/041206-1.shtml

I'd suggest moving to .net when you can, as it has controls with built-in paging that works much better.

Upvotes: 1

Related Questions