I need to write a trigger to update the identity column in the 2nd table if a new row is added to the first table's identity column.
Here's what I have (doesn't work)
create table x (col1 numeric)
create table z (col1 numeric)
CREATE TRIGGER trigger_name
ON x
FOR INSERT, UPDATE
AS
If UPDATE(col1)
BEGIN
update z set col1= x.col1 from x
END
GO
insert into x values (6)