有没有办法让 SQL Server 验证存储过程中的对象引用? [英] Is there a way to have SQL server validate object references in Stored Procs?

查看:36
本文介绍了有没有办法让 SQL Server 验证存储过程中的对象引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下代码在 SQL Server 中运行良好

The following code executes fine in SQL Server

create proc IamBrokenAndDontKnowIt as
select * from tablewhichdoesnotexist

当然,如果我尝试运行它,它会因

Of course if I try to run it, it fails with

无效的对象名称 'tablewhichdoesnotexist'.

Invalid object name 'tablewhichdoesnotexist'.

有什么方法可以编译或验证存储过程是否有效?

Is there any way to compile or verify that Stored Proc are valid?

推荐答案

我刚刚发现带有数据库项目的 VS2010 会进行语法和名称引用检查.似乎是最好的选择.

I've just discovered that VS2010 with database projects will do syntax and name reference checking. Seems like the best option.

这篇关于有没有办法让 SQL Server 验证存储过程中的对象引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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