Hello,
I currently have a Trigger on tableA which when a row of data is inserted, it will read that newly input record on tableA and copy/insert onto tableB. Lastly the trigger will then read whatever is inputted on tableB and email it to me.
I think the problems lies on one of the "text" datafield on tableA, all info are being transferred to tableB, except of the "text" datatype field. The email doesn't work too, we figure, it could be the "text" datatype.
this was working when we were using SQL Server 6.5, but when we upgraded to SQL Server 2000, it didn't work anymore.
Here's a sample code for the trigger. Thanks for any suggestion.
The first few lines are use, so as to accomodate for than 255 characters for the "text" datatype field (i.e. comments_4)
===========================================================
IF @comments4 is not null
BEGIN
INSERT tableB values (CHAR(13) + '>> What other information would you like to receive?')
INSERT tableB values (CHAR(13) + CHAR(9))
SELECT @@ptrMail = TEXTPTR(c1) FROM tableB
SELECT @@ptrComments4 = TEXTPTR(inserted.comments_4) FROM inserted
UPDATETEXT tableB.c1 @@ptrMail NULL NULL WITH LOG tableA.comments_4 @@ptrComments4
END
SELECT @emailsendto = 'myself'
DECLARE @@cmd varchar(56)
SELECT @@cmd = 'SELECT c1 FROM Database1.dbo.tableB'
EXEC master.dbo.xp_sendmail @emailsendto,
'',
@@cmd,
'',
'myself',
'',
@subject,
'',
'False',
'False',
'True',
99999
I currently have a Trigger on tableA which when a row of data is inserted, it will read that newly input record on tableA and copy/insert onto tableB. Lastly the trigger will then read whatever is inputted on tableB and email it to me.
I think the problems lies on one of the "text" datafield on tableA, all info are being transferred to tableB, except of the "text" datatype field. The email doesn't work too, we figure, it could be the "text" datatype.
this was working when we were using SQL Server 6.5, but when we upgraded to SQL Server 2000, it didn't work anymore.
Here's a sample code for the trigger. Thanks for any suggestion.
The first few lines are use, so as to accomodate for than 255 characters for the "text" datatype field (i.e. comments_4)
===========================================================
IF @comments4 is not null
BEGIN
INSERT tableB values (CHAR(13) + '>> What other information would you like to receive?')
INSERT tableB values (CHAR(13) + CHAR(9))
SELECT @@ptrMail = TEXTPTR(c1) FROM tableB
SELECT @@ptrComments4 = TEXTPTR(inserted.comments_4) FROM inserted
UPDATETEXT tableB.c1 @@ptrMail NULL NULL WITH LOG tableA.comments_4 @@ptrComments4
END
SELECT @emailsendto = 'myself'
DECLARE @@cmd varchar(56)
SELECT @@cmd = 'SELECT c1 FROM Database1.dbo.tableB'
EXEC master.dbo.xp_sendmail @emailsendto,
'',
@@cmd,
'',
'myself',
'',
@subject,
'',
'False',
'False',
'True',
99999