This blog is useful to all my friends who are working on the .Net Technology and wants to enhance their skills as well their problem solving ability.

Thursday, February 6, 2014

Update only Those records which are affected using Update Tirgger

COLUMNS_UPDATED

500 is a bit mask for checking number of columns affected or you want to check ...

IF (COLUMNS_UPDATED() & 500 > 0)
    BEGIN
            INSERT INTO TableName
            select  'update' as [Action], * from inserted 
    END

For more update or info use below link ...

http://technet.microsoft.com/en-us/library/ms186329.aspx

No comments: