Introduction:
In this
article we will learn how to take automatic backup of your Sql server
database.
sqlcmd -S
MYSQLSERVER -Q "BACKUP DATABASE Northwind TO
DISK =
'D:\MyDataBase.bak' WITH INIT, NAME = N'Automatic back up of database',
STATS =
1"
pause
This is the
command we will use to take backup of database. Follow the steps given below:
1. Change the
"MYSQLSERVER " with the name of your server.
2. Change
"MyDataBase" with the name of your database.
3. Now save
the notepad file with the extension .bat e.g. DbBackup.bat
4. Now
whenever you click on this DbBackup.bat file it will create the backup of your
database at the specified location. Here in our case in D drive.
In this way
we can take back up of database by clicking on the .bat extension file.
0 comments:
Post a Comment