O
O
Oleggatron2020-05-11 18:40:57
SQL Server
Oleggatron, 2020-05-11 18:40:57

How to reduce database size in MS SQL?

There is a database that is constantly updated with new XML status lines of the dxml table for some time dt (screenshot attached). You need to truncate the table with old data (3 months or more) and archive the truncated part. It is desirable to do everything through the command line of Windows. Help plz already broke his head.5eb9718ee5eb6287646917.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hint000, 2020-05-12
@hint000

Does your database consist of only one table? If yes, then the question is simple. Make a complete copy of the database. From the copy, delete lines younger than 3 months, from the original, delete lines older than 3 months - and you're done. https://ru.wikipedia.org/wiki/Delete_(SQL)
If there are several tables in the database, then the task can be much more difficult and requires analysis of the database structure.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question