Mike Jonson

Mike Jonson

  • NA
  • 239
  • 193.2k

Error in stored procedure "incorrect syntax near"

Jun 28 2011 4:37 AM
Create next stored procedure

CREATE PROCEDURE dbo.SearchDebiors

(
@debName nvarchar(50)
@postNumb nvarchar(50)
@phoneNumb nvarchar(50)
)

AS
select * from Debitors where
[Name] like '%'+@debName+'%' and
cast(PostNumber as nvarchar(50)) like '%'+@postNumb+'%' and
(PhoneNumber like '%'+@phoneNumb+'%' or PhoneNumber is null)
RETURN
 


and cant save, every time error "incorrect syntax near @postNumb", must declare the scale variable @debName. Please help why?

Answers (2)