Sample Header Ad - 728x90

Table partitioning for CDC enabled table

2 votes
0 answers
97 views
Is there any issue you have faced enabling table partitioning for CDC enabled tables? I have done some quick testing and table partitioning for CDC enabled tables is working well in terms of switching data. I understand, I cannot use truncate on the table or a partition while CDC is enabled:
TRUNCATE TABLE schema.tablename WITH (PARTITIONS (22));
-none
Msg 4711, Level 16, State 1, Line 96
Cannot truncate table because it is published for replication 
or enabled for Change Data Capture.
I am not sure, is it ok to disable CDC before the truncate and then enable it again? Or will that cause issues for existing CDC data capture? I believe I can back up the CDC table before disabling, do the truncate and then enable it again. Since truncate partition is done once monthly. I would like to get experienced people's suggestions before implementing in production.
Asked by Saran (107 rep)
Dec 11, 2024, 07:51 AM
Last activity: Dec 11, 2024, 11:19 AM