Hi,
I want to create a sql stored procedure wherein the local variable should store the maximum value of the column and increment it everytime the record is entered into table.
i created it like this
create procedure insertevent(......)
declare @num as int
set @num="select count(EventID) from Event"
set @num=@num+1
as
begin
insert Event(.......) values (....)
end
iam getting the error as" error converting the varchar value "select statement" from Event table of column of datatype int"
Here, the Event table column EventID is also int.
can u help me?