posted 8/29/2011 by indupriya - Views: [920]
Today I was taking a back of a database and for the past two days this has become my regular activity. So I thought there should be some kind of recording option (like recording a macro in excel) so that I can just use the recorded action whenever I need to do the same task again and again.
So I tried to investigate and found this script button. So I thought I would investigate this. The following are the steps I followed to backup a database in the Management Studio.
This has generated a nice script as shown below.
BACKUP
DATABASE [TEST] TO
DISK
= N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\TEST20110830.bak' WITH FORMAT, INIT, MEDIANAME = N'TEST', NAME = N'TEST-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 GO
GO
This script can be used to do the same task again and again and also may be you can schedule this to be processed at a certain time every day.