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 |
|
Ghanta
Yak Posting Veteran
96 Posts |
Posted - 2010-10-06 : 16:34:32
|
| Hi Guys,A list of StoreNames are passed which will be loaded into a table variable @TestTable2. I have a lookup table in the db that has the StoreNames in our example @TestTable1DECLARE @testTable1 TABLE ( StoreName varchar(128) )INSERT @testTable1 (StoreName)Select 'Rockville Pike Store1'union Select 'Wheaton Store2'unionSelect 'DC Store9'DECLARE @testTable2 TABLE ( StoreName varchar(128) )INSERT @testTable2 (StoreClosed)Select 'Pike Store1'union Select 'Store2'TestTable2 will have partial StoreName... is there a way to join these two tables using wild card character so that I can get the StoreName from Table1 for StoreNames in Table2? So I should have something like this:Table2Name Table1Name-------------------------------------------PikeStore1 Rockville Pike Store1Store2 Wheaton Store2 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Ghanta
Yak Posting Veteran
96 Posts |
Posted - 2010-10-06 : 16:44:39
|
| thanks tkizer... that works for now. |
 |
|
|
|
|
|