📜  如果找到新值,则 sp 创建唯一 id - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:23.053000             🧑  作者: Mango

代码示例3
CREATE TRIGGER TLA_Items_Adjust
  ON dbo.TLA_Items
  FOR INSERT
AS
BEGIN
  UPDATE t
  SET t.UniqueID = i.UniqueID + CAST(t.IdentityColumn AS varchar(10))
  FROM dbo.TLA_Items AS t
  INNER JOIN inserted AS i
    ON t.IdentityColumn = i.IdentityColumn
  ;
END