Home All Groups Group Topic Archive Search About

Triggers using the inserted and deleted tables with text/ntext/images

Author
8 Sep 2005 2:50 PM
Michael G via SQLMonster.com
Okay, I've read through several trees on this subject and I think I might
have an idea of what is causing a problem in my particular situation. We have
a trigger that is reading from the "inserted" and "deleted" virtual tables to
return data to a temp table. The issue is that several columns are of text,
ntext, and image datatypes. These columns are returning junk to the temp
table.

Is this because the trigger is reading from the log and that those datatypes
are stored as pointers? If so, other than changing the audit table to record
the before and after values, is there a way to query the virtual tables that
would return the actual values of those columns?

Thanks!
Michael G

Author
8 Sep 2005 3:01 PM
Laura
Search BOL for "CREATE TRIGGER".  It explains exactly what you're looking for.

Show quote
"Michael G via SQLMonster.com" wrote:

> Okay, I've read through several trees on this subject and I think I might
> have an idea of what is causing a problem in my particular situation. We have
> a trigger that is reading from the "inserted" and "deleted" virtual tables to
> return data to a temp table. The issue is that several columns are of text,
> ntext, and image datatypes. These columns are returning junk to the temp
> table.
>
> Is this because the trigger is reading from the log and that those datatypes
> are stored as pointers? If so, other than changing the audit table to record
> the before and after values, is there a way to query the virtual tables that
> would return the actual values of those columns?
>
> Thanks!
> Michael G
>
Author
8 Sep 2005 4:13 PM
Michael G via SQLMonster.com
Thanks!

Laura wrote:
Show quote
>Search BOL for "CREATE TRIGGER".  It explains exactly what you're looking for.
>
>> Okay, I've read through several trees on this subject and I think I might
>> have an idea of what is causing a problem in my particular situation. We have
>[quoted text clipped - 10 lines]
>> Thanks!
>> Michael G

AddThis Social Bookmark Button