| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-01-06 : 08:32:15
|
| Shamsu writes "I have a very simple trigger that saves a deleted record into another table for archiving. I receive errors on certain delete operations especially pertaining to text field data. I get the following error- Data size mismatch detected when transferring TEXT/IMAGE valueServer: Msg 21, Level 22, State 1, Procedure trg_inbox_bess506a_mstr_on_del, Line 8WARNING - Fatal Error 7113 occurred at Dec 22 2004 11:25PM. Please note the error and time, and contact your System Administrator.I am inserting into a text field with 1886 chars, that's the one that fails. Is there a work around or solution. I am working in sql server 6.5., old story. Here is the trigger:"Create Trigger trg_inbox_bess506a_mstr_on_delOn dbo.inbox_bess506a_mstrFor DeleteAs-- 040226, archive inbox to arcset nocount oninsert into inbox_bess_mstr_arc (pk_id,batch_id,py,appropriation,issueFrom,issueTo,submitBy,submitDate,validID,validDate,approveDate,approveBy,accountCode,transType--remark)selectpk_id,batch_id,py,appropriation,issueFrom,issueTo,submitBy,submitDate,validID,validDate,approveDate,approveBy,accountCode,transType--remarkfrom deletedreturnGO"" |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-01-06 : 08:59:49
|
from Books OnLine:quote: In a DELETE, INSERT, or UPDATE trigger, SQL Server does not allow text, ntext, or image column references in the inserted and deleted tables if the compatibility level is equal to 70. The text, ntext, and image values in the inserted and deleted tables cannot be accessed. To retrieve the new value in either an INSERT or UPDATE trigger, join the inserted table with the original update table. When the compatibility level is 65 or lower, null values are returned for inserted or deleted text, ntext, or image columns that allow null values; zero-length strings are returned if the columns are not nullable.
Go with the flow & have fun! Else fight the flow |
 |
|
|
|
|
|