我有一个如下所示的程序
BEGIN
SET NOCOUNT ON
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'X')
UPDATE TABLE X
SET ROW = 4
WHERE NAME = 'STEVE'
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Y')
UPDATE TABLE Y
SET ROW = 5
WHERE NAME = 'ART'
END
如果我希望以原子性评估两个 IF 语句,是否需要添加 BEGIN TRAN 和 COMMIT TRAN 封装?