Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Using LIKE with a Variable 2

Status
Not open for further replies.

Cenedra

Programmer
Jan 2, 2003
114
US
here is my stored proc:

CREATE PROCEDURE sp_SearchByEmail
(

@Email varchar(100)= null
)
AS



SELECT username, users.id as UserID, displayname
from UserProfiles
join users on users.id = userprofiles.id
where email like '%@Email%'
GO


The liek part isn't working like I want it to.... if I run the same thing in QA, but replacing the last part to look like this:

where email like '%@fuse.net%'

but when I run it from my application, it doesn't return what I get in QA.

Does anyone know the proper way to get the results I need?

Thanks tons in advance
 
Code:
SELECT username, users.id as UserID, displayname
from UserProfiles
join users on users.id = userprofiles.id
where email like '%' + @Email + '%'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top