Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unable to preserve trigger
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01412205
Message ID:
01412209
Vues:
42
The error tells you exactly what the problem is. The large data type varchar(max) cannot be converted to sql_variant data type. You'll have to first convert varchar(max) to varchar(nnnn). Something like
...
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.
>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
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform