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
DBconvAsked:
Who is Participating?
 
Raja Jegan RConnect With a Mentor SQL Server DBA & ArchitectCommented:
Just use the script provided over here:

http://www.mssqltips.com/tip.asp?tip=1174

And do it the reverse way for your Restoration script too.
0
 
gothamiteCommented:
incidentally, you can use the SQL extended sp xp_delete_file to delete backup files directly from within SQL.
0
 
Alpesh PatelAssistant ConsultantCommented:
You can do easily using SSIS packages.
There are some task to maintain SQL Server objects and else more.
0
 
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+.  

http://msdn.microsoft.com/en-us/library/ms177182.aspx
http://msdn.microsoft.com/en-us/library/ms187658
0
 
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.
0
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.