SQL Server Query Window what I mean is the place where you are creating / altering your stored procedure. It looks like there should be some problem with @SQL value only. Can you post your SET @SQL = 'Select..... ' statement here.
Ok..Here I am copying my stored procedure as it is
ALTER PROCEDURE dbo.bporesults
(
@datediff int ,
@city varchar(20),
@role varchar(100)
)
AS
DECLARE @SQL NVARCHAR(1000)
SET @role = '''' + REPLACE(@role,',',''',''') + ''''
SET @SQL='SELECT Companyname, Role, Moreaboutjob, candidate,Experience,Location,salarymin,salarymax,Interviewdate,postdate FROM callcenter where Location Like ''%' + @city + '%'' and DATEDIFF(Day, postdate, getdate( ) ) <=''' + @datediff + ''' and Role
in (' + @role + ')'
EXEC sp_executesql @SQL
closeguy2005
Participant
887 Points
1746 Posts
Re: problem in pattern matching..
Sep 18, 2008 06:29 PM|LINK
Ok..Here I am copying my stored procedure as it is
ALTER PROCEDURE dbo.bporesults
(
@datediff int ,
@city varchar(20),
@role varchar(100)
)
AS
DECLARE @SQL NVARCHAR(1000)
SET @role = '''' + REPLACE(@role,',',''',''') + ''''
SET @SQL='SELECT Companyname, Role, Moreaboutjob, candidate,Experience,Location,salarymin,salarymax,Interviewdate,postdate FROM callcenter where Location Like ''%' + @city + '%'' and DATEDIFF(Day, postdate, getdate( ) ) <=''' + @datediff + ''' and Role in (' + @role + ')'
EXEC sp_executesql @SQL