在sql server 2005中执行测试
当我执行以下...
EXEC 'DROP TABLE bkp_anish_test'
('DROP TABLE bkp_anish_test'
是动态构建 sql 查询)
时,我收到以下错误
找不到存储过程“DROP TABLE bkp_anish_test”。
When I am executing following ...
EXEC 'DROP TABLE bkp_anish_test'
('DROP TABLE bkp_anish_test'
is a dynamically build sql query)
I am getting following error
Could not find stored procedure 'DROP TABLE bkp_anish_test'.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
改为执行此操作:
或者对于动态构建字符串的情况:
Do this instead:
or for the case of a dynamically built string:
尝试在命令中添加括号。如果要使用 EXEC 命令,则必须在运行 SQL 语句时包含它们。
Try adding parentheses to your command. You must include them when running a SQL statement, if you're going to use the EXEC command.
您不需要使用 EXEC 来运行 sql 语句。 则运行,试试这个
在查询编辑器中,如果表位于 xyz 数据库中,
You dont need to use EXEC to run the sql statement. In the query editor, just run
if the table is in xyz database, try this