SQL Server存储过程行号问题 [英] SQL Server stored procedure line number issue

查看:105
本文介绍了SQL Server存储过程行号问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SQL Server 2008 Enterprise。我遇到了一个问题,该问题说存储过程foo的第9行遇到了死锁问题。我的问题是如何准确地找到存储过程的第9行?

I am using SQL Server 2008 Enterprise. I met with issue which says line 9 of stored procedure foo is meeting with dead lock issue. My question is how to find exactly the 9th line of the stored procedure?

我的困惑是由于编码格式问题,如何正确定位第9行。

My confusion is because of coding format issue, how to locate 9th line correctly.

预先感谢,
George

thanks in advance, George

推荐答案

这是第9行CREATE PROCEDURE语句。 SQL语句通常是多行,因此第9行将引用该语句的第一行(例如INSERT或UPDATE)

It's the 9th line from the CREATE PROCEDURE statement. A SQL statement is often multiline so "line 9" will refer to the first line of the statement (eg INSERT or UPDATE)

但是,如果您在CREATE上方有注释过程或空白行之前,您将不能依靠它...因此,将ALTER PROC作为批处理中的第一行运行ALTER PROC。

However, if you have comments above the CREATE PROCEDURE or blank lines before it then you can't rely on this... so run ALTER PROC with ALTER PROC as first line in the batch.

这篇关于SQL Server存储过程行号问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆