Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unable to preserve trigger
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01412205
Message ID:
01412208
Views:
34
What is compatible level of the database?


>Hi All,
>
>I am not able to change the datatype from varchar(1000) to varchar(max) in one of my SQL Server 2005 table.
>The error is pointing to the AFTER UPDATE trigger with the following message:
>
>
>- Unable to preserve trigger 'tr_auditUpdates'.  
>Operand type clash: varchar(max) is incompatible with sql_variant
>
>
>..and here is the trigger:
>
>
>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
>
>
>Thank you,
>Daniel
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform