0
有谁知道检查交易何时发生的命令?如何检查交易何时发生
BEGIN TRAN
BEGIN
--- Do stuff with @id
INSERT INTO tbl_1(id, col_1, col_2)
SELECT @id, @val_1, val_2,
..
.....
.........
END
IF (@@ERROR <> 0)
BEGIN
ROLLBACK TRAN
END ELSE
BEGIN
COMMIT TRAN --> would like to know when this started or logged?
-- Thinking about adding "exe some_trans_log getDate(), 'start - web_sp @id'" here
EXEC web_sp @id --> this takes a while to execute
-- Thinking about adding exe some_trans_log getDate(), 'end - web_sp @id'
END
我不认为有必要在您的交易中添加日志记录,但我可能是错的。