Hi all,
i need to create an insert trigger where everytime there is an insert on the table i want the recordid column to go old value plus one.
my trigger look something like this but its not working properly!
CREATE TRIGGER TRGname ON table_name
FOR INSERT
AS
declare @id int
select @id = max(recordid) from table_name
update table_name set recordid = @id + 1
Any input will help!
i need to create an insert trigger where everytime there is an insert on the table i want the recordid column to go old value plus one.
my trigger look something like this but its not working properly!
CREATE TRIGGER TRGname ON table_name
FOR INSERT
AS
declare @id int
select @id = max(recordid) from table_name
update table_name set recordid = @id + 1
Any input will help!