Search This Blog

Wednesday, January 12, 2011

Enable CDC

If that table having primary key
EXEC
sys.sp_cdc_enable_table @source_schema = N'dbo', @source_name = N'TABLE_NAME', @role_name = null, @supports_net_changes = 1
If that table doesn't  having primary key

EXEC sys.sp_cdc_enable_table @source_schema = N'dbo', @source_name = N'TABLE_NAME', @role_name = null, @supports_net_changes = null

Only for paticular columns in one table

EXEC sys.sp_cdc_enable_table @source_schema = N'dbo', @source_name = N'TABLE_NAME', @role_name = null, @supports_net_changes = 1,
@captured_column_list
'column names separated by comma (i.e. id,name)
sys.sp_cdc_enable_table @source_schema = N'dbo', @source_name = N'TABLE_NAME', @role_name = null, =' id ,name'

No comments:

Post a Comment