Information générale
Forum:
Microsoft SQL Server
Titre:
Triggers & Capturing Data via INSERTED and DELETED tables
I created a trigger for a table and was able to capture a value from the INSERTED and DELETED temp tables for fields that are defined as INTERGER and CHARACTER datatype. My Problem is that I'am unable to do the same for a field that is define as a TEXT datatype. The first two SELECT statements listed below work OK, but the second set of SELECT statements listed below do not work. MADDRESS field has a datatype of TEXT. The result is that the variables @DeletedmAddress and @InsertedmAddress seem to contain the values from the INSERTED tables. The value from the DELETED table is overlooked. I am wondering if this is a bug in MicroSoft SQL Enterprise Manager version 6.50.201. I would appreciate some help or explanation of my problem. PLEASE RESPOND.......
/* **** Capture values from Deleted and Inserted table */
SELECT @DeletediAddType = (SELECT iAddType FROM DELETED)
SELECT @InsertediAddType = (SELECT iAddType FROM INSERTED)
SELECT @DeletedmAddress = (SELECT CONVERT(VARCHAR (20),mAddress) FROM DELETED)
SELECT @InsertedmAddress = (SELECT CONVERT(VARCHAR(20),mAddress) FROM INSERTED)
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement