Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm working on a school project where I have a SQL Server with a database for my team.

I already imported a local database created with Entity Framework.

Now the model has changed, table properties were added/deleted and I want to update my full database.

However, the teachers didn't gave us the create rights so dropping the whole database isn't really an option.

Now is my question, is it possible to drop all the tables currently in the database and just import the newly created one without problems? Or do I really need to drop the whole database?

share|improve this question
1  
You can just drop the old tables and create the new ones if you have permissions to drop and create tables. –  ypercube May 19 '13 at 16:21
3  
If you want to do this automatically, you may find this answer useful: Drop all the tables, stored procedures, triggers, constriants and all the dependencies in one sql statement –  ypercube May 19 '13 at 16:26
1  

1 Answer 1

I assume you are trying to push your changes back to the database from your entity model? If so you can do that from studio. (Right click in the entity modeler, save changes to the database.)

If you have to recreate it - you can also just change where the EF is pointing in your configuration settings and push the model out to the database if you have create permissions. Really just depends what rights you were given.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.