|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
VeriSign Code Signing Digital Certificates provides assurance to end users. Read about this and more in the free white paper: “How to Digitally Sign Downloadable Code for Secure Content Transfer.” Learn More! |
|
#1
|
|||
|
|||
|
hi All.
I'll be brief. I am trying to make a search on my database using the "LIKE" and also a parameter.my Quary looks like this - select * From table where info Like '%'+?+'%'( the ? is for the parameter). whenever i put a string in the parameter' all working fine, but if i put nothing- leave it blank, i get All the records, which is the Opposite of what i need, if i leave it blank, i should get Nothing!! why is that? and how can i overcome this problem? maybe using a stored procedure will help, just tell me what to write in!! Thanks Ofir |
|
#2
|
||||
|
||||
|
Why not just fix your application so that if the value of the parameter is null, then don't call the query at all.
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > using LIKE in order to search problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|