-2

I have a requirement to create SSIS package to restore .bak files and while restoring, package have to shrink .mdf files?will the package fulfil the requirement?

Thanks.

Amelia
  • 159
  • 1
  • 3
  • 17
  • Why do you want to use SSIS as it can be done by T-SQL? How many databases do your process involves? Explain your process. – p2k Aug 18 '16 at 11:17
  • 150 databases involves. Instead of SQL we need SSIS package. is it possible? – Amelia Aug 18 '16 at 11:50

1 Answers1

0

There is no any task for Database restore in SSIS. However, you can take help of LOOP and Script task to make it.

http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/automate-database-restore-to-remote/

You can use the SHRINK DATABASE TASK to shrink the databases. It uses the command DBCC SHRINKDATABASE that can be implemented in previous approach as well.

p2k
  • 2,126
  • 4
  • 23
  • 39
  • Thanks. is there any stored procedure to restore database, I am not familiar with coding. – Amelia Aug 18 '16 at 12:52
  • No, there is no system SP to restore db. you can create your own. Refer: http://dba.stackexchange.com/questions/11308/automating-a-database-backup-restore-and-stored-proc-call – p2k Aug 18 '16 at 12:58