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 |
SQLBoy14
Yak Posting Veteran
70 Posts |
Posted - 2014-03-10 : 14:20:09
|
Hi all,I have a parameter @CustInd from a Column with varchar(4) data format called Customer_Index. Now if I want to let the users to input the value (for example) '%FFDS%' (FFDS is one of the values from Customer_Index) to get the output, how do I write it in where clause?Thank you allSQLBoy |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-03-10 : 14:34:38
|
WHERE Column1 LIKE @var1Or:WHERE Column1 LIKE '%' + @var1 + '%'Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
 |
|
SQLBoy14
Yak Posting Veteran
70 Posts |
Posted - 2014-03-10 : 14:40:02
|
Thank you Tara. I will test it and let you know.SQLBoy |
 |
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2014-03-11 : 02:46:31
|
If using LIKE - beware of index scans and the potential impact that may have on the response time of a queryJack Vamvas--------------------http://www.sqlserver-dba.com |
 |
|
SQLBoy14
Yak Posting Veteran
70 Posts |
Posted - 2014-03-11 : 14:44:08
|
Hi Tara. It is working. Thank you. Hi Jack, thanks for the update.SQLBoy |
 |
|
|
|
|