2
Answers

Error in stored procedure "incorrect syntax near"

Mike Jonson

Mike Jonson

13y
3.3k
1
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)