Create databases snapshot from executionblock
PeterHageus
Posts: 11
Hi. I got a schema and a data executionblock that I wan't to persist as a database snapshot. Whats the best way to do this? I'd rather not script it into a livedatabase.
TIA, Peter
TIA, Peter
Comments
1) Save the ExecutionBlock as a file (with the SaveToFile method) in its own folder
2) Register that folder as a script database
3) Save that script database as a database snapshot
I don't guarantee that this will always work, but it's probably your best option if you don't want to script it into a live database.
You won't get the data component that way though, because we haven't implemented read-from-scripts for data yet.
How did you end up with an ExecutionBlock that you want to persist as a database snapshot? Maybe you could save something from earlier in the process that would be easier to turn into a snapshot?
Redgate Software
The reason I ended up with executionblocks is that I haven't found a way to filter a Database.SaveToDisk.
I want the entire schema of the database, but only data from a subset of the tables in my snapshot. Since one of the tables contains rather many rows, I figured a snapshot was the best way to persist it.
Redgate Software
The snapshot will be created from a live db, but I don't want all the data in it (and I don't want to maintain a separate 'empty' model-db).
Whilst we currently only have a v5 of the SQL Packager API (which means that it only works with v5 of the Compare and Data Compare APIs), we're planning to update it for SQL Server 2008 support for the release of SQL Server 2008, which will include updating it to work with the latest SQL Compare and Data Compare engines.
Redgate Software
Or can I make Compare/Data Compare work against the output of Packager somehow? As far as I could see I could only save as .exe or project.
I think the most logical and clean solution would be if Packager could output a database snapshot.