我有以下插入触发器,它本质上是将插入中的重复行写入 QA/QC 表(IAW 业务要求)。
INSERT dbo.TBL_LOCATIONS(
Column1, Column2
)
SELECT
a.Column1, a.Column2
From
(
SELECT
Column1, Column2
FROM inserted
) AS a
end
GO
我正在尝试做的是根据插入表中插入的可能值的逻辑测试填充[Column1]一系列tbl_locations值,例如如果[a.Column1]是“1”,则在中插入“一些字符串” tbl_locations.Column1,如果[a.Column1]是“2 ", 然后在 中插入 "Some other string" tbl_locations.Column1, 如果是 "3", 然后在...[a.Column1]中插入 "Yet another string"tbl_locations.Column1