Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Dev@nlkss
134 Posts |
Posted - 2008-12-16 : 06:18:17
|
Hi all,I have created sql job for backup process and placing in a folder as prespecified filename.when first time job executes it created specified filename and taken backup succesfully and when it executes for next schedule it takes the latest backup successfully but as in same previous file name but my intention is to store it as new seperate file.plz help methanks in advance.Satya |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-16 : 07:06:48
|
have you specified anywhere to save it as new file? how are getting backup now? using t-sql statements or procedure? |
 |
|
Dev@nlkss
134 Posts |
Posted - 2008-12-16 : 07:30:52
|
I used following command in sql job"BACKUP DATABASE DevDB TO DISK = 'D:\DailyBackups\DevDB.dat'"Satya |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-16 : 07:47:59
|
then make the backup filename dynamic. something likeSET @Sql='BACKUP DATABASE DevDB TO DISK = ''D:\DailyBackups\DevDB''+ CONVERT(varchar(11),GETDATE()) +''.dat''EXEC (@Sql)this will ensure it will backup each day to a new file like D:\DailyBackups\DevDB20081216.dat |
 |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-12-16 : 09:38:27
|
use maintenance plan task in SSIS. |
 |
|
Dev@nlkss
134 Posts |
Posted - 2008-12-16 : 09:39:27
|
Thanks visakhits working fineand i have to work on following DBA aspects from this weekend onwards1.Index creation2.Performance tuning3.replication4.online restorewhat are the best ways to undestand these topics,is there any articles or free online books or any linksplz send meSatya |
 |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-12-16 : 09:48:21
|
Why use dynamic sql when Maintenance plan can name your backup file with date time stamp |
 |
|
NeilG
Aged Yak Warrior
530 Posts |
Posted - 2008-12-16 : 09:55:49
|
I agree with sodeep, why use the system resources to run a dynamic sql statement when if you use either a ssis package or create a subplan in a maintenance plan this will automatically insert the date time stamp for you |
 |
|
Dev@nlkss
134 Posts |
Posted - 2008-12-17 : 00:35:15
|
Actually i dont have any idea on SSISplz guide me how to use itor is there any links to learnthankQSatya |
 |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-12-17 : 10:52:35
|
You can simply do with Maintenance plan. You can use Wizard or SSIS under it? |
 |
|
|
|
|