Reputation: 904
ALTER PROCEDURE [dbo].[usp_SaveUserCustomerXRef]
@Username varchar(48),
@LinkID varchar(48)
AS
DELETE FROM UserCustomerX WHERE UserName=@UserName AND LinkID=@LID
INSERT INTO UserCustomerX(Username, LID)
VALUES (@Username, @LID)
is executed As-
EXEC usp_SaveUserCustomerXRef '10026:ttmm19','2H0';//Executed+Inserted
The columns in the table UserCustomerX are of type Varchar.My problem is with case no:2 why does it insert values though there is no single quotes.But Case No:1 gave syntax error.Case 3&4 are normal conditions. Why does case 2 work? without quotes?
Upvotes: 0
Views: 42
Reputation: 490
Your second paramter @LinkID is a varchar, so you better force and generalize the use of quotes when executing your stored procedure.
And as Nicarus said, it's probably an implicit conversion to number which provoke the syntax error.
Upvotes: 1