I was getting the following error:
Msg 50000, Level 16, State 1, Procedure Product_Audit_Update, Line 460
error in [dbo].[Product_audit_update] trigger
Msg 3616, Level 16, State 1, Procedure ProductSave, Line 126
Transaction doomed in trigger. Batch has been aborted.
Turns out the following line of code was causing the problem:
AND isnull(Inserted.[guidColumn],'') <> isnull(Deleted.[guidColumn],'')
As as example:
declare @guid uniqueidentifier
declare @guid1 uniqueidentifier
set @guid=newid()
if (@guid <> isnull(@guid1,''))
print 'this works'
Causes this error as well:
Msg 8169, Level 16, State 2, Line 6
Conversion failed when converting from a character string to uniqueidentifier.
I would suggest removing the isnull(,'') and allow the column values to compare by themselves.
AND Inserted.[guidColumn] <>Deleted.[guidColumn]
Shane.