T-SQL will return every record in this case.  % is a placeholder for any
characters, so your query would essentially tell the database "where x = any
pattern of characters" and would return everything.

You could just run a query with that syntax in Query Analyzer or Management
Studio and see for yourself what happens.



-----Original Message-----
From: Scott Stewart [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 30, 2007 3:13 PM
To: CF-Talk
Subject: OT: SQL "Like"

Hey all, 

 

Here's a weird question.

 

We have a query that uses like in the where clause.  The like variable is
passed dynamically.

Where x like #arguments.blah#%. If nothing is passed via arguments.blah, the
where clause looks like this

 

"where x like %" 

 

How does T-SQL interpret this? Or does it just ignore the clause..

 

Thanks, as always..

 

sas

 





Scott Stewart
ColdFusion Developer 

HYPERLINK
"http://maps.yahoo.com/py/maps.py?Pyt=Tmap&addr=7241+Jillspring+Ct&csz=Sprin
gfield%2C+VA.+22152&country=us" \n7241 Jillspring Ct
Springfield, VA. 22152 


HYPERLINK "mailto:[EMAIL PROTECTED]" [EMAIL PROTECTED]
HYPERLINK "http://www.sstwebworks.com"; \nhttp://www.sstwebworks.com 


tel: 
mobile: 

HYPERLINK
"http://www.plaxo.com/click_to_call?src=jj_signature&To=703-912-3076&Email=s
[EMAIL PROTECTED]" \n703-912-3076 
HYPERLINK
"http://www.plaxo.com/click_to_call?src=jj_signature&To=703-220-2835&Email=s
[EMAIL PROTECTED]" \n703-220-2835 

 



HYPERLINK
"https://www.plaxo.com/add_me?u=25770055805&src=client_sig_212_1_card_join&i
nvite=1" \nAlways have my latest info

HYPERLINK "http://www.plaxo.com/signature?src=client_sig_212_1_card_sig";
\nWant a signature like this?

 


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.22/739 - Release Date: 3/29/2007
1:36 PM
 
  




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 by AdobeĀ®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274236
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to