Skip to content
Advertisement

SQL Server: backup all databases

I was wondering if there was any way of making a backup of an entire SQL Server (we are using SQL Server 2008) at regular intervals to a specific location. I know we are able to backup single specific databases but for ease of use and not having to set up a backup each time I want a new database, is there a way to do this?

If there is however, I must have a way of restoring just a single database from that server backup easily as though I have backed them up individually.

The method used will just be a pure backup and not a difference so no need to worry about complications.

Advertisement

Answer

You can run the following script, just change the @path variable to where you want to store the databases.

Obtained from:

http://www.mssqltips.com/sqlservertip/1070/simple-script-to-backup-all-sql-server-databases/

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement