none
change tracking for particular columns and not for whole table

    Question

  • Hi,

    I am using sql server 2008. I am aware that we can enable change tracking for a table using below sample script,

    ALTER TABLE dbo.test
        ENABLE CHANGE_TRACKING
            WITH(
                TRACK_COLUMNS_UPDATED = ON  
            );
    GO

    But I want to enable change tracking for only few columns in my table . Say my table has 40 columns and I want to enable change tracking for only 3 columns in that. Is that possible ? please let me know the script to check it.

    I understand that we can use:

    [CountChanged?] =
    CHANGE_TRACKING_IS_COLUMN_IN_MASK(COLUMNPROPERTY(OBJECT_ID('test'),
    'Count', 'ColumnId'), SYS_CHANGE_COLUMNS),

    but, if we can do change Tracking for the selected columns, this will reduce overhead to some extend.

    Let me know your thoughts.


    Please mark as helpful and propose as answer if you find this as correct!!! Thanks, Rakesh.

    Monday, April 29, 2013 2:38 PM

Answers

All replies