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 |
|
java148
Yak Posting Veteran
63 Posts |
Posted - 2011-11-28 : 09:43:04
|
how to use variable in like clause ? for example :declare @name varchar(100);set @name = 'myname';-- doesn't work select * from mytable where name like '%@name%' Thanks |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-28 : 10:23:06
|
it should beselect * from mytable where name like '%' + @name + '%' ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
java148
Yak Posting Veteran
63 Posts |
Posted - 2011-11-28 : 12:35:16
|
| thanks |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-28 : 12:39:39
|
| wc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|