sql - Not able to detect error in stored procedure -


i new stored procedure.

i have written following stored procedure:

create proc sp_taxbrock begin    declare @inttax int,@intbrockrage int,@sum int    set @inttax = (select tax partyregister partycode = '0l036')    set @intbrockrage = (select brockrage partyregister partycode = '0l036')     set @sum = @inttax+@intbrockrage     select @sum    print @sum    /*print @inttax+@intbrockrage;*/ go 

it causing error:

msg 102, level 15, state 1, procedure sp_taxbrock, line 12
incorrect syntax near '@sum'.

not able find mistake.

i tried adding semicolons (;) @ different locations, still error same.

please me.

add end before go.

create proc sp_taxbrock begin    declare @inttax int,@intbrockrage int,@sum int   set @inttax =(select tax partyregister partycode='0l036')   set @intbrockrage=(select brockrage partyregister partycode='0l036')    set @sum = @inttax+@intbrockrage    select @sum   print @sum /*print @inttax+@intbrockrage;*/ end go 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -