views:

125

answers:

2

I'm working with an SQL Server database with about 50 tables and plenty of relationships between those tables. I have already written a backup and restore function which will retrieve all data from the model, export it to XML which it could then import again into a clean database. But maintaining this import/export is a lot of work when there are some major structural changes to the entity model. I want a more dynamic solution.

Is there a more dynamic solution to export data from an entity model and to import it back again into a clean database?

Oh, before I forget... I don't have direct access to the database itself, not it's connection. All I get and all I can use is this entity framework object...

+1  A: 

Have you tried the SQL Server Publishing Wizard? It creates a nifty formatted SQL file that can be easily moved between application, I've also also used (with some search&replace based on regular expression) to move data from SQL Server to Oracle...

Regards
Massimo

massimogentilini
I see that you do not have DB connection, so this solution could not apply...
massimogentilini
I don't have a DB connection, indeed. Even if I could ask the Entity Model for a connection string, using it for anything else is out of the question. (I'd probably end up with a footprint on my behind if I even tried this.)
Workshop Alex
+2  A: 

I would be passing this back to your server support team. Seems a bit strange for an app developer to have to worry about data backup/restore.

AUSteve
Nothing strange to it. The data stored in the server is used for further development, but I need a backup for testing of some more complex batch updates. I prefer to do them on the most recent backup.
Workshop Alex