Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Search by each word in a phrase
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01331706
Message ID:
01331733
Views:
11
Do you think it would be a good idea to have 4 possible optional parameters?

>Hi everybody,
>
>I'm thinking of writing an SP that would attempt to seach mutltiple fields by each word in a phrase. Here is a part I'm not sure how to handle.
>
>Say, I pass "Name1 Name2" and I need to create a query like this
>
>select ... from ... where (field1 like "Name1%" or field2 like "Name1%" etc.) and (field1 like "Name2" or ...)
>
>I can get a list of words into table valued function, but does it mean I would have to create a dynamic SQL? In this case I don't need an SP, I guess.
>
>Since I would probably have just few words (less than 4, I guess) I may try to code with IF statements...
>
>Appreciate your ideas.
>
>Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform