Home » Forum

Forum

Use wildcard in dyn...
 
Notifications
Clear all

Use wildcard in dynamic query for Temporary table


Sandip Patil
(@sandip)
New Member
Joined: 3 years ago
Posts: 1
Topic starter  

Need to follow few commons steps

1. Just create one Temp table with values 

2. Apply join on the temp table 

3. Use the below query with wildcard operator

declare @sql nvarchar(max)='' 

Set @sql=@sql + 'select * from Table a 

Inner Join @TempTable tmp on a.Value like ''%''+Tmp.Value+''%'''

 exec (@sql)

Quote
Share: