January 23, 2015 at 11:06 pm
Hi,
I need to implement a logic in the package.
The package has to restore a database from the production backup into another server everyday. We are currently taking weekly one full backup and daily differential backup.
In the package whenever it run it has to check the backup date, if the full backup is available with package run date then it has to restore with the full backup. If the full backup date is older and if differential backup is available then it has restore with that old full backup + diff backup.
How to implement this logic in SSIS package. Is the script task works for this? How to write the code to implement such logic
January 26, 2015 at 5:18 am
You'll need to use variables to store the date of each backup and then use those variables together with precedence constraints to route your logic accordingly. You don't need to use a script task for this, but more to the point, you don't need to use SSIS for this - a stored procedure can encapsulate all of the logic that you need.
Regards
Lempster
January 26, 2015 at 6:03 am
Thank you
January 26, 2015 at 7:11 am
You're welcome!
January 26, 2015 at 5:27 pm
Hi Lempster,
To give you some more clarification, why I am using SSIS package
Currently the backups are residing in one server but database has to restore in another server.
I have to get that backup files to separate server and then restore database from that backup then run some DML after everything is done then delete the backup files from the local machine.
Current my plan keep the full backup in the local machine until next full backup with out deleting but needs to check the full backup date. If the full backup date is recent than the backup date on local machine then delete the old backup and keep this ..
Is it possible through Stored procedure?
If you have any of sample code, please provide to me.
Thank you
January 27, 2015 at 1:33 am
ramana3327 (1/26/2015)
Currently the backups are residing in one server but database has to restore in another server.I have to get that backup files to separate server and then restore database from that backup then run some DML after everything is done then delete the backup files from the local machine.
Current my plan keep the full backup in the local machine until next full backup with out deleting but needs to check the full backup date. If the full backup date is recent than the backup date on local machine then delete the old backup and keep this ..
Is it possible through Stored procedure?
If you have any of sample code, please provide to me.
Thank you
Yes, you can still do all of that in a stored procedure, but you'll need to set up Linked Servers between instances on different servers.
Regards
Lempster
January 27, 2015 at 10:20 am
Ok. Thank you
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply