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.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 wild card character search

Author  Topic 

sureshprabhu
Starting Member

32 Posts

Posted - 2007-09-19 : 10:21:25
Hi!

I am developing one web site, in that I can upload files to sql server, it will save the uploaded file in binary type and we can download the files from there. Upto this everything is working perfectly. But now my problem is - i have to implement the wildcard character search in this site. The file name and extension will save on the database in different columns, and one more thing is file name is unique. I confused to implement wildcard search in this site, where i can implement this type of search in database or in my application with c#? So please help me to do this. I dont know that this is the right place to post this question or not. If it is not right place, please guide me to where I can post this. If it is right place, please help me to implement wild card search.

Thanks in advance!

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-09-19 : 10:56:31
SELECT * FROM Table1 WHERE Col1 LIKE '%' + @SearchParam + '%'

SELECT * FROM Table1 WHERE PATINDEX('%' + @SearchParam + '%', Col1) > 0



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-09-20 : 04:10:45
or
SELECT * FROM Table1 WHERE CHARINDEX(@SearchParam , Col1) > 0

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -