Using wildcard character in Stored Proc
Hi!,
Can anyone help in how do I use wildcard character in SQL Server Stored Proc. When I try to use the wildcard as '%@location%', it is read as a string. Here is the snippet of the code:
CREATE Procedure GetInquiryByLocFormat
(
@loc varchar (25),
@format varchar (50),
@total integer OUTPUT
)
As
SELECT @total = SUM(inquiry_assign)
FROM tblRep
WHERE (camp_loc LIKE '%@loc%' ) AND (cl_format LIKE '%@format%')
GO
Any help will be appreciated
Nirav
|