Possible Duplicate:
Using variable in SQL LIKE statement
I want it to be like this and its ok..
Declare @modCode varchar(3)
SET @modCOde = 'SOR';
Select dbo.ApplyModuleCode(@modCode, Num)
From Doc_SalesOrder
Where Num not LIKE @modCOde
but I want to use it like this.
Declare @modCode varchar(3)
SET @modCOde = 'SOR';
Select dbo.ApplyModuleCode(@modCode, Num)
From Doc_SalesOrder
Where Num not LIKE %@modCOde%
How can I achieve what I want?
Does this work?