在.net中我们经常用到try catch.不过在sqlserver中我们也可以使用try catch捕捉错误,在这里把语法记录下来和大家分享一下, --构建存储过程CREATE PROCEDURE TestProc @Para INTAS BEGIN TRAN DECLARE @tran_error int SET @tran_error = 0 BEGIN TRY ---这里是存储过程的业务逻辑 DELETE FROM table END TRY BEGIN CATCH --捕捉错误 …
传送门 Catch That Cow Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 80273 Accepted: 25290 Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 10…