Home > Forum > ASP.NET > mistake in my procedure in sql server

mistake in my procedure in sql server

by celv   on Oct 25, 2014   Category: ASP.NET  |  Views: 933    |  Points: 5   |  Bronze 
  Reply
CREATE PROC atendance (
@Id int,
@Name varchar(50) ,
@Status varchar(50) ,
@Section varchar(50),
@Date varchar(50),
@intime datetime,
@outtime datetime,
@action varchar(50)

)

as
begin
if(@action='select')

begin
select name,section,id as idd from EmpReg where id not in (select id from aten where date =@Date)
end
else if(@action='insert')

begin
insert into absentdays(id,name,section,date,status) values (@id,@name,@section,@date,@status)
end
else if(@action='update')

begin
update aten set outtime=@outtime where id=@id, name=@name, date=@date
end

end


my error

Msg 102, Level 15, State 1, Procedure atendance, Line 28
Incorrect syntax near ','.


Bookmark and Share:
 
  User Reply  | Ask a question  |   Reply 
  Re :mistake in my procedure in sql server   
by Thamil
on Oct 26 2014 2:05AM
Points : 10
Gold 
hi celv

Check this below line, replace the [and] instead of [,]
update aten set outtime=@outtime where id=@id and name=@name and date=@date
  Re :mistake in my procedure in sql server   
by celv
on Oct 26 2014 2:58AM
Points : 10
Bronze 
thanks tj
  Re :mistake in my procedure in sql server   
by celv
on Oct 26 2014 3:06AM
Points : 10
Bronze 
i need to throw error

Recent Post

Latest Posts