Click here to Skip to main content
16,018,496 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am getting the error 170, incorrect syntax near @chk.


below is the stored procedure.

Create Proc spCompareGrossWeight(@HouseBillId varchar(36), @HouseBillNumber varchar(36), @GWeight varchar(36), @chk int output)
as
begin
declare @weight int
declare @gwt int

SELECT @weight= SUM(GWeight)
FROM HouseBills
WHERE (ReferenceHouseBillId = @HouseBillId)

set @gwt = GWeight

if (@weight = @gwt)
@chk = 1
else
@chk = 0
end
Posted

Set @chk = 1

instead of @chk = 1
 
Share this answer
 
if (@weight = @gwt)
   set @chk = 1
else
   set @chk = 0
end


SET the parameter

Cheers
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900