SQL Server 错误行号

时间:2022-09-09 07:14:07

https://msdn.microsoft.com/zh-cn/library/ms178600.aspx

返回发生错误的行号,该错误导致运行 TRY…CATCH 构造的 CATCH 块。

 
返回值

当在 CATCH 块中调用时:

  • 返回发生错误的行号。

  • 如果错误发生在存储过程或触发器中,则返回例程中的行号。

如果在 CATCH 块作用域以外调用,则返回 NULL。

示例

A.在 CATCH 块中使用 ERROR_LINE

下面的代码示例显示生成被零除错误的 SELECT 语句。 返回发生错误的行号。

1. BEGIN TRY
2. -- Generate a divide-by-zero error.
3. SELECT 1/0;
END TRY
BEGIN CATCH
SELECT ERROR_LINE() AS ErrorLine;
END CATCH;
GO

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVAAAAB3CAIAAADaVI+0AAAJD0lEQVR4nO3czW6jyBoG4LonVrma3nEvlrJ1pNp5EWVzdDY+N+B1XNJoRjPj0YyY7rTT6R5PWjGO7RAM4iwqwQUFn38aV2HqffTJwhiqDPjtArcDy9zQu+y7U3OAGsx2Eg3pXfYTNyDwQKgOvM9FZXl+uQzn9mi9y/6iaDQajUajYdFgcL04Zwg80GoDz0X2Vjzza+qsA895+c3PZjOfcytBbQoCD7R9R3h9bPd84XnnFPiwKA98GIbiMROP2c3t3Pd5eM42mw0CD4TqwKuj33g8zqdHo5GciKKIc+F5fuXqTPEjKW2kEUmPgdzGyWQihBiPxze3c86F73Mrh6EpCDzQdgc+D3mWZcPhMMuyKIrCMORcXFxcEFktTRxNb+GINnuX/acizgUXYjgcci4Gg2tZvs+fzhkCD7Tq5AwG15PJZDwej4pkPOSXW2cX+O9F+jX8ze38bagXggsRBMH3evLUQ51ogziOEXgg1AY+n1ZHeM6FvFYUj9lgcE0HXj8bL80pnfnrE/lidMv7XEH0LvuPRZyL6XQ6m81ms5kQ2c3t/OZ2rm6p5/lBEDzWkN2pE22AwAPtgFP6KIqGw2H4/hXXzsCXsqqP+cTQTQRen7PPgN+77P9bxLkIgqBw8iJElmUZ5xn3ORfj8Vh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Xs352WUeIzy0XyHw+l0l2clu/7jzGv7sAo8RHtqvEHj9LlfsZLd/JK7hz/SUHiM8tJ/NwGOEBzCsjSP8mQYeIzy0XzHw2m3t2IH3ddu/Kkf4s/7SDiM8tJ/NwNeNk7iGBziRQuBL97E86BaOhxZ+aQdgXiHwJu8qiV/aAZhXDLzBu0pihAcwrxB4kzeZwwgPYJ7NwGOEBzCsEHiTN3vECA9gXum39OZghAcwz+ZNLOe27znZ+KPdYwmw0zbwdt8HABiAwAM4BIEHcAgCD+AQBB7AIQg8gEP+D9B3oj6tqq0yAAAAAElFTkSuQmCC" alt="" />

begin try前面的空行也会计算在内,测试如下:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbUAAAEaCAIAAAAZgl6xAAAVmklEQVR4nO3dT4/cRnrHcb6PvIKc2xddcl/kkFOQP4cYiIEOgiCHAEF0yMFCAMNQIJ28EsCDFzKgWLCDcQztyljnEM9uctIQWMexpIXkXlsaWbLHcjQ9Go1GPT3pHDhis1lPFYuc6qoi+f3gwYBik6xudvdPxb+d7DaxyB18vPjfv1zWwccLOxu3T1sA4E1CPgKAKEw+JklCPgKInMt8/Be9fIIiHMlHAPFznI9iG5V8pP8IoBPIRwCQkY8AIHOfj3+8akE+Augm+o8AIIsiH+2PaAOANwHyMXmFfAQQswDnP56mAMAbr9fPfPTF7M5f/eP2T/7kf/7+nz/68njj9uLGrx/rxvziv74nHwEEtMZ8VDe3b/z6u3uv/92///zW5M//5ot/uPiL//z+1t/+k27MJ59tk48AAvKaj5/8x/bHvznYuPV/v/z0q/t/9BcP/vDPJn/617ox//b5oZqPt3/oWwGIltd8PP3+x/4VgGiRj+QjABn5SD4CkAW4/6N6/qNlJclKiSOL8eWHDEvQDVs+AfNTslkmgGj5Pv+xclp4i4hUh80j1WyqjKlEW23r5b+NnhL5CHSL7+tn1p2P9jHXIh91sxuGaxcIIFphrr8+TT6KW821iVkbcJZxpotXdSOafAS6Llg+truFjy4W1T2APvNRN6PN0gBEq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OSj+pPLCRr+2UrXf+xu/lI/xHomZD5qIZgMaaL+Uj/EeiZGPuPheCR16joPwI9s5qPyk/QJA1/g8W+OH4NIHIh89HcF+tcRNJ/BHpmJR8rP9HV6NepmhbXzwCI3Eo++vzBLK6fARC51Xz0+INZ9B8BRG4lH33+IAz9RwCRC5mP9B8BxGwlH33+jhX9RwCRq1x/7Q/9RwCRC/n7XLuhf07L+d+w7yUAt5b5GPZ5AEBsyEcAkJGPACAjHwFA9v8KuJv1gs4WegAAAABJRU5ErkJggg==" alt="" />

B.带存储过程在 CATCH 块中使用 ERROR_LINE

下面的代码示例演示一个生成被零除错误的存储过程。 ERROR_LINE 返回发生错误的存储过程中的行号。

-- Verify that the stored procedure does not already exist.
IF OBJECT_ID ( 'usp_ExampleProc', 'P' ) IS NOT NULL
DROP PROCEDURE usp_ExampleProc;
GO -- Create a stored procedure that
-- generates a divide-by-zero error.
CREATE PROCEDURE usp_ExampleProc
AS
SELECT 1/0;
GO BEGIN TRY
-- Execute the stored procedure inside the TRY block.
EXECUTE usp_ExampleProc;
END TRY
BEGIN CATCH
SELECT ERROR_LINE() AS ErrorLine;
END CATCH;
GO

结果显示行号是从GO之后开始计算

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfoAAAGvCAIAAAA8NIBaAAAgAElEQVR4nO3dTYskx53H8Xwf+wr23L7osu/CCF1kWEOB0EknHXRwYzBGQnOyJaiDlzHIEvayYGbxwSfPWV2w3mXlMaPpteSWpdFYlrrnoafV063YQ01nZ8XDP/75FJGZ8f2QNFlRGQ+ZVfWr6Oys6uq4DbN1+lvz9b9eL6e/NQCAaauIewAoAXEPAEWYU9xX+9V2sdY7tCM33tNQ7UynowFNcMw8Xm0N+GIJNT5Gy1YvY3cxQXOKe7P7IA34gNVNDfX+0aod/cY9O9Ib9cUwwVdasiFNZ9/7j2S8fVnSUZoU4n6Apoj76TTeDXGfpYX0Lbc1nZEMYmZxb64eAOthcH+7tE77yJtZ5fqzRt7qzUHK4w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xn1ojsy5ewAY3E7cW/+dvNU/5m678KlaAEhpJ+5T/q9wPlULACntxn3C/xXO7B4AUtqJ+5T/PJbZPQCklDPumd0DQDI7cZ/yX3gzuweAlKzvzEmH2T0ApJTzX5Mf5/5P4oP/zPtYAoDgOu7zjgMAMCriHgCKQNwDQBGIewAoAnEPAEX4f9mDdsHD3rezAAAAAElFTkSuQmCC" alt="" />

C.带其他错误处理工具在 CATCH 块中使用 ERROR_LINE

下面的代码示例显示生成被零除错误的 SELECT 语句。 错误的相关信息与发生错误的行号一同返回。

BEGIN TRY
-- Generate a divide-by-zero error.
SELECT 1/0;
END TRY
BEGIN CATCH
SELECT
ERROR_NUMBER() AS ErrorNumber,
ERROR_SEVERITY() AS ErrorSeverity,
ERROR_STATE() AS ErrorState,
ERROR_PROCEDURE() AS ErrorProcedure,
ERROR_LINE() AS ErrorLine,
ERROR_MESSAGE() AS ErrorMessage;
END CATCH;
GO

结果如图:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqsAAAFuCAIAAAAptMY8AAAgAElEQVR4nO3dT28byZnH8X4f+wr2rLnMZd9FzgE2AN/CHKNLEBjwnBIPwEMCB5idQbJYIPAih5zi84jAZoMkDjxRZjyef3GcHUn+J1MUag9tt5pV9Tz1dLP/1/eDhtAsdldVtyjVj0WyWZw15Eovf+3+799vlpe/dgAAYD4KEgAAABkaOgEUxd4SLazK63cpNUjrxg7oXbLUCQDA7HScAP5DdtPk/nBuKQxHX6/EG7y1Ay78n426BADAMnSfAKLNNEoAUolyrz0BSLsr6wz/AIDlGScBROf2pZV4v2NDuH3AjgaIcKqfBAAAWKoJzQGEr8Rr/e46AUg7MvwDABaplwTwvX2uyasA0RXp2bl388AEEN2XBAAAWKQJzQH4PVPfiKcM4SQAAACSppgA2n0WoFrp8J2A0aYBAFiAoROA/uH76DsElXftRT+vnxyzpdbDFqMvQAAAsAAjXA8AAACMjqsCAwCQo34TAE/9AQCYJhIAAAA5IgEAAJAjEgAAADkiAQAAk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CYII=" alt="" />

ERROR_LINE对我们调试定位查询错误的时候有很大的帮助。