Initiate a retore of xyz.bak from SSIS

  • I have a process that retrieves a zip file from a FTP site, it unzip's the file, now I need to initiate a restore of a database. Can someone help me with this?

    Thanks,

    Jeff

  • have it unzip it to a defined location and name them write a SQL command restore

    Restore ....

    Then put that in as a SQL task or define it with an OSQL task in a bat job and call that.

  • The zip file will always be extracted to the following:

    c:\RealPage_FTP\U1050266.bak

    I'm good with SQL from a data perspective, but not on the admin side. How would I write a SQL statement to restore this file over the existing database 'RealPage'?

    thanks,

    Jeff

  • I went through the steps of the restore, but instead of executing, I scripted it.

    Does this correct?

    RESTORE DATABASE [RealPage]

    FROM DISK = N'C:\RealPage_FTP\U1050266.bak'

    WITH FILE = 1

    ,NOUNLOAD

    ,STATS = 10

    GO

  • The quickest way would be to do it from Mgmt Studio and instead of clicking ok use the script option to script it out.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply