TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Roland
NA
11
0
Store sub-results (rows) during a query and filter them by input parameters
Nov 15 2009 2:06 PM
I need to write a filter function for my application where I have to filter by - a searchstring - min. price - max. price - category for now. I have read a bit about dynamic sql and that it's slow to execute and unsafe. I have an idea for my task, but I'm not sure if it's possible. I would like to create a stored procedure which runs a default query. select * from Items There will be 4 input parameters @exp nvarchar(max), @minprice decimal, @maxprice decimal, @catid int After the default query I need to store the result somehow and run an other query depending on the value of @exp lets say. if @exp NOT NULL select * from earlierResults(?) where itemname like '%'+@exp'%' Basically I need to replace the earlierResults with something. Plus I'm not sure how the column names will work from these results. And I need to further filter it down with the other parameters.
Reply
Answers (
2
)
Windoes 7 and SqlExpress 2005 Trust error
Large List
resources problem