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 2000 Forums
 SQL Server Development (2000)
 Developing a search

Author  Topic 

macca
Posting Yak Master

146 Posts

Posted - 2008-03-25 : 08:29:19
I am trying to develop a search. I have 2 variables being passed in one of which is name and the other is address. I want to be able to display all the records in my database even if I only input a portion of a name as the variable. I suppose I want to get all records returned as if you were using the LIKE keyword. An example is if I input 'John' and it brings back all the records with 'John' in the Name field e.g. 'John Doe', John Bloggs' etc.

Anyone any ideas how to do this?
macca

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-03-25 : 08:32:56
you mean like this...?

where name like '%' + @name + '%'

Em
Go to Top of Page

macca
Posting Yak Master

146 Posts

Posted - 2008-03-25 : 11:20:19
yes,like that.
How would you put that in a stored procedure?

Thanks
macca
Go to Top of Page
   

- Advertisement -