有一个小问题,想知道我是否正确使用了这些。
在我的 SQL 脚本中有
BEGIN TRY
// check some information and if there are certains errors
RAISERROR ('Errors found, please fix these errors and retry', 1, 2) WITH SETERROR
// Complete normal process if no errors encountered above
PRINT 'IMPORT SUCCEEDED'
END TRY
BEGIN CATCH
PRINT 'IMPORT ABORTED. ERRORS ENCOUNTERED'
END CATCH
但是,这会遇到错误,然后继续执行脚本的其余部分。我错过了什么?谢谢!