Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Columns in inserted table for a trigger

Author  Topic 

GregDDDD
Posting Yak Master

120 Posts

Posted - 2010-11-11 : 12:00:17
I tested this and it seems to work, but I want to make sure I understand it. I have a trigger on a table that is for insert and update. If one column on one row is updated then all columns on that row are available in the virtual insert table? Is this correct?

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-11-11 : 12:07:51
yes the entire row is available
Go to Top of Page

GregDDDD
Posting Yak Master

120 Posts

Posted - 2010-11-11 : 12:28:45
Thank you
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2010-11-11 : 13:13:32
If I recall correctly I think that blob type columns like image,text,etc are not available directly through inserted/deleted tables.

Be One with the Optimizer
TG
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2010-11-11 : 13:32:12
Kinda sorta.. :)

From BOL:
quote:
SQL Server 2008 does not allow for text, ntext, or image column references in the inserted and deleted tables for AFTER triggers. However, these data types are included for backward compatibility purposes only. The preferred storage for large data is to use the varchar(max), nvarchar(max), and varbinary(max) data types. Both AFTER and INSTEAD OF triggers support varchar(max), nvarchar(max), and varbinary(max) data in the inserted and deleted tables. For more information, see CREATE TRIGGER (Transact-SQL).
Go to Top of Page
   

- Advertisement -