Skip to main content
Question

Restore SQL.bak file from FME script

  • May 23, 2024
  • 1 reply
  • 73 views

dustin
Influencer
Forum|alt.badge.img+30

We have a SQL .bak file which serves as a template for a database schema. Normally this .bak is restored manually via MSSQL, where the name of the database is specified.

The goal is to be able to dynamically create a database on a known server, where the name of the database is derived from processing within the FME workspace.

Is there a script that can be run from a SQLExecutor in FME to make this possible?

1 reply

virtualcitymatt
Celebrity
Forum|alt.badge.img+35

So this article seems pretty helpful:
https://www.ubackup.com/enterprise-backup/sql-restore-database-from-bak-file-1021.html

For the the best answer for you in there is:

By running:

RESTORE DATABASE databasename FROM DISK = 'filepath\filename.bak'

Seems like this should work from an SQLExecutor 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings