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.
| Author |
Topic |
|
liptonIcedTea
Starting Member
26 Posts |
Posted - 2008-06-12 : 00:09:29
|
| Hi,okay so I'm refactoring some code at the moment. At the moment, I'm working on a search screen. This search screen lets the user enter a number of criterias, I'm working on drags data from a view and then programmatically filters it according to the search filters.This is obviously inefficent and non-scalable as the view drags out every entry and returns to the data layer, which then filters it.I'm wondering what the best way to refactor this? i'm thinking the best way is to tell the db what to filter on, so it'll only drag out the right amount of data.Therefore, should I keep the view? Is there any way of entering parameters into views or am i going to need to change this into a stored proc? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-12 : 00:42:13
|
| I think you can use a stored procedure which accepts your serach parameters and gives you filtered result. Is it simply retrieval of table data or will you be doing some calaculations on them? |
 |
|
|
liptonIcedTea
Starting Member
26 Posts |
Posted - 2008-06-12 : 01:22:39
|
| i think a stored proc would be the best method also, i just don't wanna change too much that's all, so i was thinking if i could stick with the view it'd be great.no calculations, the only thing i want to do is filter out rows based on search criterias(eg. Surname) |
 |
|
|
|
|
|