Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deleting entry in SQL Server 2005 - Conversion failed when converting varchar value to data type int

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:

Conversion failed when converting the varchar value 'D' to data type 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.

Any suggestions?

like image 854
Mourndark Avatar asked Oct 29 '25 16:10

Mourndark


1 Answers

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).

like image 163
Damien_The_Unbeliever Avatar answered Oct 31 '25 05:10

Damien_The_Unbeliever



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!