May 14, 2008 at 6:25 am
Does anyone know of a good tutorial or manual that explains how to use T-SQL to backup an SQL Sever db?
Thanks!
M
May 14, 2008 at 6:33 am
hmm books online? http://msdn.microsoft.com/en-us/library/ms186865.aspx
May 15, 2008 at 12:22 am
- In Management Studio, right click on the database.
- Select tasks -> Backup...
- There's a button called 'Script' at the top of the next screen that will create a script.
To fully understand the script, search 'Backup' in Books Online (Content type = T-SQL)
May 15, 2008 at 5:57 am
And to summarize the topic on BOL:
BACKUP DATABASE NorthWind
TO DISK='C:\NorthWind.20080515.SQLBackup.Full.bak'
May 15, 2008 at 4:04 pm
Check out my script on this site - http://www.sqlservercentral.com/scripts/Backup/62095/. And if you run the sp_DatabaseBackup with @Debug=1 setting, it will show you the backup commands it executes.
May 16, 2008 at 5:31 am
I have a backup stored procedure as well, that you are welcome to use.
EXECUTE dbo.DatabaseBackup @databases = 'USER_DATABASES', @Directory = 'C:\Backup', @BackupType = 'FULL', @verify = 'Y', @CleanupTime = 24
Here it is doing a full backup of all user databases, verifies the backups and on success deletes all files that are older than 24 hours.
http://ola.hallengren.com/sql-server-backup.html
Ola Hallengren
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply