sql database back up using a .bat file

I am trying to create a script that will delete an existing back up at a specific location (a)
and Create a back up of the database to the same location (a)

Also trying to achieve the same with restoring the database
Who is Participating?
Raja Jegan RConnect With a Mentor SQL Server DBA & ArchitectCommented:
Just use the script provided over here:


And do it the reverse way for your Restoration script too.
incidentally, you can use the SQL extended sp xp_delete_file to delete backup files directly from within SQL.
Alpesh PatelAssistant ConsultantCommented:
You can do easily using SSIS packages.
There are some task to maintain SQL Server objects and else more.
DrewKjellConnect With a Mentor Commented:
You should look into utilizing SQL Maintenance plans as this is a built in part of the system in SQL 2005+.  

Steve WalesSenior Database AdministratorCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.