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 |
|
shebert
Yak Posting Veteran
85 Posts |
Posted - 2009-08-03 : 16:05:03
|
| Hi Allany one know how to add a wildcard to a variable?exampledeclare @wild intset @wild=16select * from anytable where tableid like @wild+'%'I want all records in anytable begining with 16 |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2009-08-03 : 16:11:14
|
| what datatype is [tableid] ?Is it INT like your @wild variable? So you want any id like 16, 162, 1600034?Or is it some type of varchar? If so just make your variable varchar then you statement would work.Be One with the OptimizerTG |
 |
|
|
shebert
Yak Posting Veteran
85 Posts |
Posted - 2009-08-03 : 16:20:20
|
| I bow to your SQL wisdom....all set |
 |
|
|
|
|
|