SQL Backup Script for SQL Server Databases
SQL Server administrators (DBA ’s) and t-sql developers frequently use pre-created sql backup script to backup sql databases in their SQL Server instances.
An easier and a best practice for SQL backup tasks is to create sql maintenance plans and backup sql database in a schedule using SQL Server jobs.
But sometimes, SQL professionals feel better to backup database, before running a t-sql script that they think that it might effect the database negative or think that it may delete or damage data in sql tables in that sql database.
In such cases, instead of running SQL Server Management Studio and start a sql backup wizard for the target SQL database, it is easier and faster to run a sql backup script to backup database to disk drives on a target folder.
Here is a sql backup script that you can use to take sql backup of SQL Server databases on your server.
BACKUP DATABASE [AdventureWorks2008]
TO DISK = 'D:\SQLDatabases\AdventureWorks2008.bak'
If the above backup database script is successfull the SQL Engine will print a message similar to below :
Processed 23088 pages for database ‘AdventureWorks2008′, file ‘AdventureWorks2008_Data’ on file 1.
Processed 36 pages for database ‘AdventureWorks2008′, file ‘FileStreamDocuments’ on file 1.
Processed 2 pages for database ‘AdventureWorks2008′, file ‘AdventureWorks2008_Log’ on file 1.
BACKUP DATABASE successfully processed 23125 pages in 5.291 seconds (34.144 MB/sec).
Leave a Comment
You must be logged in to comment