Answer the question
In order to leave comments, you need to log in
How to delete data for a period and check for integrity?
The database has grown in 5 years to a huge size. What commands to do the cleaning of data, leaving the last year? What commands to check for integrity and optimize?
Answer the question
In order to leave comments, you need to log in
What commands should be used to trunk data and leave data for the last year?
TRUNCATE TABLE PartitionTable1
WITH (PARTITIONS (2, 4, 6 TO 8));
GO
DELETE FROM table WHERE date <= %date%
DELETE TOP (1000) FROM table WHERE date <= %date%
What commands to check for integrity and optimize?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question