删除SQL Server 2005中的条目 - 将varchar值转换为数据类型int时转换失败

时间:2021-03-08 08:49:57

I'm manually editing a table in SQL Server 2005 and am trying to delete a single record, but I keep getting the following error:

我在SQL Server 2005中手动编辑表,并尝试删除单个记录,但我不断收到以下错误:

Conversion failed when converting the varchar value 'D' to data type int

将varchar值'D'转换为数据类型int时转换失败

None of the columns, int or otherwise contain the value 'D', so I'm very confused by this. I've checked all the tables in the DB where this entry's Primary Key is a Foreign Key, but nothing there either.

没有列,int或其他包含值'D',所以我对此非常困惑。我已经检查了数据库中的所有表,其中此条目的主键是外键,但也没有。

Any suggestions?

1 个解决方案

#1


3  

Sounds like there may be a trigger defined on this table - probably some form of auditing.

听起来这个表上可能有一个触发器 - 可能是某种形式的审计。

(I'd guess an audit trigger, since I'm guessing it's trying to insert a row in another table with a D to indicate deletion, but I'm also guessing the table definition has changed and the column is now an int column).

(我猜一个审计触发器,因为我猜它试图在另一个表中插入一行用D表示删除,但我也猜测表定义已经改变,列现在是一个int列) 。

#1


3  

Sounds like there may be a trigger defined on this table - probably some form of auditing.

听起来这个表上可能有一个触发器 - 可能是某种形式的审计。

(I'd guess an audit trigger, since I'm guessing it's trying to insert a row in another table with a D to indicate deletion, but I'm also guessing the table definition has changed and the column is now an int column).

(我猜一个审计触发器,因为我猜它试图在另一个表中插入一行用D表示删除,但我也猜测表定义已经改变,列现在是一个int列) 。