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 |
|
purell
Starting Member
17 Posts |
Posted - 2010-03-06 : 02:02:19
|
| set @code=938-99123Currently I have "select name from table1 where code like '%' + @code + '%'But it won't work when I search for:"9__-____3" or if I want to do exact search "___-__123" (only ending in 123).How can I do this? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-03-06 : 02:15:13
|
| if you want ones ending with 123 useselect name from table1 where code like '%' + @codethen pass @code as 123------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-03-08 : 02:13:10
|
quote: Originally posted by purell set @code=938-99123Currently I have "select name from table1 where code like '%' + @code + '%'But it won't work when I search for:"9__-____3" or if I want to do exact search "___-__123" (only ending in 123).How can I do this?
What do you mean by "It wont work?"Did you get error or wront result?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|