gpt4 book ai didi

sql-server - throw 语句前加分号

转载 作者:行者123 更新时间:2023-12-02 20:32:54 28 4
gpt4 key购买 nike

最佳答案

它可以解决一些歧义

比较

BEGIN TRAN THROW --Starts a transaction named "THROW"
BEGIN TRY
SELECT 1 / 0
END TRY

BEGIN CATCH
ROLLBACK TRAN
THROW /*Rolls back the transaction named "THROW"*/
END CATCH

BEGIN TRAN THROW --Starts a transaction named "THROW"
BEGIN TRY
SELECT 1 / 0
END TRY

BEGIN CATCH
ROLLBACK TRAN; /*rolls back the tran without caring about the name*/
THROW --rethrows the error
END CATCH

关于sql-server - throw 语句前加分号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48141513/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com