Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 2
    Solutions like DhavalR's will restore only the basic database structure. Most of them will not re-generate things like user acounts and permissions, triggers, jobs, (because EF doesn't see them), or stored procedures, UDFs (because EF only sees their definition, not inner code), etc, and even won't re-generate any views/tables/UDTs/etc that previously existed in the database but the EF model hadn't included them (you forgot or have no need for). Obviously, re-generating the DB will also not recover any data rows. If you need to get back anything of those, look for db backups/snapshots asap. Commented May 11, 2018 at 6:58
  • 1
    If you have .bak file, choose "generate database from model" option from EDMX designer and restore the contents of .bak file into that DB. Commented May 11, 2018 at 6:59
  • @quetzalcoatl :- You are right. I am updating my answer mentioning your point. I checked what you said about sp's and all. This generates only basic db structure. Commented May 11, 2018 at 7:07