执行sql命令时出现错误 [英] Getting error while executing sql command

查看:100
本文介绍了执行sql命令时出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

每当我运行以下查询时:

从email_data删除,其中exp_date< getdate()
我收到以下错误:

消息208,级别16,状态1,过程trgInsteadOfDelete,第9行
无效的对象名称"email_test"

请告诉我错误是什么

Hi all

When ever i am running the below query:

delete from email_data where exp_date < getdate()
I am getting the below error:

Msg 208, Level 16, State 1, Procedure trgInsteadOfDelete, Line 9
Invalid object name ''email_test''

Please tell me whats the error

推荐答案

您需要在第9行查看存储过程"trgInsteadOfDelete"-问题是该过程正在由触发器调用发生删除时,它可能正在查看错误的表.
You need to look at your stored procedure "trgInsteadOfDelete" at line 9 - the problem is that the procedure is being called by a trigger when a delete occurs, and it is probably looking at the wrong table.


根据您的问题:您收到一条错误消息,指出表''email_test''不存在,但您声明自己尝试从email_data
删除
因此,在代码中执行数据库之前,请重新检查您正在对数据库执行的语句.您正在使用的SQL字符串是在某个地方更改还是包含错字.
based on your question: You get an error saying that the table ''email_test'' does not exist but you state that you try to delete from email_data

So re-check the statement you''re executing against the database just before it''s executed in the code. Is the SQL string you''re using changing somewhere or does it contain a typo.


这篇关于执行sql命令时出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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