C# .NET - i want to create database backup on location whatever i choose...

Asked By Trisha on 02-Mar-11 02:30 AM
i want to create database backup on location whatever i choose... how to do that ???
Reena Jain replied to Trisha on 02-Mar-11 02:37 AM
hi,

Taking backup of any specific database to your desired location is very easy using this simple SQL command.

backup database myDataBase to disk = 'd:\myDbBackup.bak'

Hope this will help you
Jatin Prajapati replied to Trisha on 02-Mar-11 02:44 AM
you can also take multiple backup at another location also:

here is the script for this:

BACKUP DATABASE [AdventureWorks] TO
DISK =
N'D:\AdventureWorks.bak'
MIRROR TO DISK = N'E:\AdventureWorks.bak'
WITH FORMAT, INIT,
NAME = N'AdventureWorks-Full Database Backup'
GO


Ravinder Jamgotre replied to Jatin Prajapati on 02-Mar-11 04:54 AM
What database are you trying to backup in the first instance, is SQL as the examples given are SQL based?