... CAST(b.cTechDescript AS varchar(4000)), CAST(a.cTechDescript AS varchar(4000)), ...>I am not able to change the datatype from varchar(1000) to varchar(max) in one of my SQL Server 2005 table.
>- Unable to preserve trigger 'tr_auditUpdates'. >Operand type clash: varchar(max) is incompatible with sql_variant >>
>ALTER TRIGGER [tr_auditUpdates] >ON [dbo].[m_itemUpdate] >AFTER UPDATE >AS > > IF UPDATE(cTechDescript) > BEGIN > IF EXISTS (SELECT * > FROM inserted a > JOIN deleted b ON a.cSKUId = b.cSKUId > WHERE a.cTechDescript <> b.cTechDescript) > BEGIN > INSERT INTO m_itemUpdateTrsn > SELECT a.cSKUId, 'TechDescription' as cValueName, > b.cTechDescript, a.cTechDescript, > a.cLastUpdateBy, GETDATE() as dUpdateOn > FROM inserted a JOIN deleted b ON > a.cSKUId = b.cSKUId > END > END >>