views:

107

answers:

1

Dear All, can any one post any link/tutorial which will explain how to search data from a table in sql server ,like using some stored procedure...any example? In details: Lets say I have a table havinh columns ID,title,username description etc, so now first it will search for username and then title and so on.

+1  A: 
DECLARE @search nvarchar(50)
set @Search = 'Some String'


SELECT 
        * 
FROM 
        Table
WHERE 
        Username like '%' + @search + '%' 
OR 
        Description like '%' + @search + '%' 
OR  
        Title like '%' + @search + '%'

Is that what you're getting at ?

Eoin Campbell