question

sqlqa avatar image
sqlqa asked

Want to search Dynamically from User Input String in Data presented in Tables at SQL

Hi, I have Product It have product information over 10k Records. We have Created Full Text INDEX and using CONTAINSTABLE(),FREETEXTTABLE(),FREETEXT() This functions are uses only word by word search. Create Proc DynamicSearchProductName(@pdname varchar(300)) AS Begin DECLARE @cmd varchar(500) SET @cmd ='SELECT * FROM Production.dbo.Products WHERE FREETEXT(a.Name, '''+CAST(@pdname AS VARCHAR(500))+ ''') Exec(@cmd) End My problem is FreeText search Word by Word. But My Requirements need letter by letter Match case search. (i.e) Sp needs to search if any letter input from parameter should match to tables Product and dispaly results as see below example: EXEC DynamicSearchProductName @pdname='Or' **Output:** **Product Name** Orient Product Ormant Product 2 rows Affected. Is any function or operator there to search letter by letter in SQL other than LIKE Operator?
tsqlfull-textsearch
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

seanlange avatar image seanlange commented ·
0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.