DROP TRIGGER T_UNKNOWNPKVC1
DROP TRIGGER T_UNKNOWNPKVC2
go

DROP TABLE UNKNOWNPKVC1
DROP TABLE UNKNOWNPKVC2
go

CREATE TABLE UNKNOWNPKVC1
(
    ID     NUMERIC(38)          PRIMARY KEY,
    NAME   VARCHAR(32)         NULL,
    VERSION NUMERIC(19)        NOT NULL
)

CREATE TABLE UNKNOWNPKVC2
(
    ID     NUMERIC(38)          PRIMARY KEY,
    NAME   VARCHAR(32)         NULL,
    VERSION NUMERIC(19)     NOT NULL
)
go

CREATE TRIGGER T_UNKNOWNPKVC1
   ON UNKNOWNPKVC1
   FOR UPDATE as
   begin
       UPDATE UNKNOWNPKVC1
           SET UNKNOWNPKVC1.VERSION = UNKNOWNPKVC1.VERSION + 1
           FROM inserted
       WHERE UNKNOWNPKVC1.ID = inserted.ID
           AND UNKNOWNPKVC1.VERSION = inserted.VERSION
   end
go

CREATE TRIGGER T_UNKNOWNPKVC2
   ON UNKNOWNPKVC2
   FOR UPDATE as
   begin
       UPDATE UNKNOWNPKVC2
           SET UNKNOWNPKVC2.VERSION = UNKNOWNPKVC2.VERSION + 1
           FROM inserted
       WHERE UNKNOWNPKVC2.ID = inserted.ID
           AND UNKNOWNPKVC2.VERSION = inserted.VERSION
   end
go
