Link to home
Start Free TrialLog in
Avatar of Vijay
Vijay

asked on

T-SQL for Delete backups

How to write T-SQL to compare two existing sql backups (.bak) in a given location and delete old backups?
This is sql server 2016?
SOLUTION
Avatar of Kelvin Sparks
Kelvin Sparks
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Vijay
Vijay

ASKER

Hi Ajay,

Let me try and get back to you.
Avatar of Vijay

ASKER

Mark  Yes. We already configured maintenance plans . But this requirement  is for some testing.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What do you want to compare?
If they are the same backup file? Then check the file names, sizes and date and time.
Vijay, please let us know if this issue has been solved or if you need further help.
Avatar of Vijay

ASKER

Thank you very much Virot
Avatar of Vijay

ASKER

Thank you Vitor.