Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Delete old backup files

Author  Topic 

yadhu_cse
Constraint Violating Yak Guru

252 Posts

Posted - 2010-12-07 : 08:29:20
TO DELETE OLDER FILES OLDER THAN CERTAIN DAYS. I DO HAVE A JOB THAT CREATES A FULL DAILY BACKUPS BUT SINCE I DON'T HAVE ENOUGH SPACE, I WOULD LIKE TO FIND A WAY TO DELETE ALL OLD BACKUP FILES OLDER THAN X AMOUNT OF DAYS AND ALSO DELETE TRANSACTION FILES OLDER THAN X AMOUNT OF DAYS. IS THERE A TOOL TO DO THIS. CAN ANYONE HELP PLEASE.

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2010-12-07 : 08:38:16
First of all: STOP THE SCREAMING. It's really annoying.

I've used a nice little program called delold.exe which I've found very easy to use: http://winhlp.com/node/386. I've also used xp_cmdshell with a custom script but that requires a somewhat standard file naming convention. Delold works regardless of filenames.

- Lumbago

My blog (yes, I have a blog now! just not that much content yet)
-> www.thefirstsql.com
Go to Top of Page

yadhu_cse
Constraint Violating Yak Guru

252 Posts

Posted - 2010-12-07 : 23:32:10
i want to know in vb .net
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-12-08 : 00:18:09
quote:
Originally posted by yadhu_cse

i want to know in vb .net



You can execute the exe in Vb.Net which Lumbago has designed.

PBUH

Go to Top of Page

yadhu_cse
Constraint Violating Yak Guru

252 Posts

Posted - 2010-12-08 : 00:37:12
can u tel me how to perform backup using vb.net
Go to Top of Page

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-12-08 : 01:00:00
Hi Yadhu,

Please stop the practice of opening multiple threads for same requirement.

You have asked the same question in earlier thread:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=153652

wherein I replied:
-------------
The article explains how to take backup and restore.
http://www.sqlteam.com/article/backup-and-restore-in-sql-server-full-backups

In same screen you find a button on top with caption "Script" which can be used for generating SQL script for the action.
You can take the script and embed it in sp.

-------------
In that thread, the requirement was how to embed the backup script in SP. In this thread, the same requirement for vb.net.

To repeat for you:
Follow the article. In one of the screen you will find button on top with caption "Script" which can be used for generating SQL script for the action.

Take the script and embed it in VB.net. If you are not clear on how to put the sql script in vb.net then please do check with dotnet forums experts.

If you are not clear with the explanation, you can ask for more clarification in the same thread.


Regards,
Bohra
Go to Top of Page
   

- Advertisement -