Create procedure [dbo].[spExactSearch] ( @Keyword nvarchar(255) ) AS BEGIN SELECT TenderID ,TenderTitle ,ProductCatID ,P.ValueTypeName as ProductCatName ,TenderValue ,Location ,LastDateForSubmission FROM TenderDetail TD(NOLOCK) INNER JOIN ValueType P(NOLOCK) ON TD.ProductCatID=P.ValueTypeID WHERE CONTAINS((ProductSubCatName), @Keyword) Order By TD.CreatedDate desc END
--You can store each word with single quote separated by commas into @Keyword variable --Pass string with single quote ' seperated by , comm Declare @Keyword varchar(200) = '''First'',''third'',''fifth''' Declare @Query varchar(500) set @Query = 'select * from TenderDetail where ProductSubCatName in (' + @Keyword + ')' exec (@Query)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)