-
using 'Text' column in deleted trigger
Hi
I have a delete trigger which needs to insert data (for archiive purpose) from deleted table . here is the code :
create trigger td_member_message on member_message
after delete
as
begin
declare @numrows int,
@errno int,
@errmsg varchar(255),
@now datetime
select @numrows = @@rowcount, @now = getdate()
if @numrows = 0
return
insert member_message_arch
select d.*, @now
from deleted d
return
/* Errors handling */
error:
raiserror @errno @errmsg
rollback transaction
end
go
But I am getting error here like:
Msg 311, Level 16, State 1, Procedure td_member_message, Line 20
Cannot use text, ntext, or image columns in the 'inserted' and 'deleted' tables.
I know using of instead of trigger can get rid of this error but I cannot think of using instead of trigger in this case.
CAn anyone pls help me?
Thanks in advance
-
Possible to list columns (except text or image column) instead of d.* in your trigger? Is it on sql2k8 by the way?
-
yes, it is in sqlserver 2008
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|