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.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Database BackUP

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 me
thanks 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?
Go to Top of Page

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
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-16 : 07:47:59
then make the backup filename dynamic. something like
SET @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
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-12-16 : 09:38:27
use maintenance plan task in SSIS.
Go to Top of Page

Dev@nlkss

134 Posts

Posted - 2008-12-16 : 09:39:27
Thanks visakh
its working fine
and i have to work on following DBA aspects from this weekend onwards
1.Index creation
2.Performance tuning
3.replication
4.online restore

what are the best ways to undestand these topics,
is there any articles or free online books or any links
plz send me



Satya
Go to Top of Page

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
Go to Top of Page

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
Go to Top of Page

Dev@nlkss

134 Posts

Posted - 2008-12-17 : 00:35:15
Actually i dont have any idea on SSIS
plz guide me how to use it
or is there any links to learn
thankQ


Satya
Go to Top of Page

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?
Go to Top of Page
   

- Advertisement -