<p>How do you create a database from an Entity Data Model.</p>

<p>So I created a database using the EDM Designer in VisualStudio 2008, and now I want to generate the SQL Server Schema to create storage in SQL Server. </p>

[{'answer_id': 61304, 'author': 'Till', 'author_id': 2859, 'author_profile': 'https://Stackoverflow.com/users/2859', 'pm_score': 2, 'selected': True, 'text': '<p>From what I understand you are not just supposed to use EDM as a "pretty" database designer, in fact EDM does not depend on a specific storage layer. It tries to abstract that part for the developer. There are design schemas (CSDL) and storage schemas (SSDL). Anyway, don\'t mean to lecture you. ;)</p>\n\n<p>There is <a href="http://msdn.microsoft.com/en-us/library/bb387165.aspx" rel="nofollow noreferrer">EDM Generator</a>, which you use to create models and class, etc.. For a DDL kind of export, I\'ve never done that but what I did was map my EDM to an existing database, which was easier for me to get started.</p>\n\n<p>There is a great tutorial on MSDN, which details step by step instructions on how to go about using an existing database, but also touches the how to start from scratch approach.</p>\n\n<p><a href="http://msdn.microsoft.com/en-us/magazine/cc163286.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/magazine/cc163286.aspx</a></p>\n'}, {'answer_id': 62991, 'author': 'JRoppert', 'author_id': 6777, 'author_profile': 'https://Stackoverflow.com/users/6777', 'pm_score': 0, 'selected': False, 'text': '<p>The Feature "Generate Database Schema from Model" is scheduled for a future release of Entity Framework. V1 does\'nt support schema generatiorn based on EF models.</p>\n'}, {'answer_id': 135171, 'author': 'scotta', 'author_id': 2066290, 'author_profile': 'https://Stackoverflow.com/users/2066290', 'pm_score': 0, 'selected': False, 'text': "<p>I believe the other answers implied this, but just to be explicit - use SSMS (or whatever equivlent if you're a brave sole and not using SQL Server provider) to design the DB layout and then suck that into EDM - and then apply application changes as necessary to the model.</p>\n\n<p>I spent about an hour trying to do it your way first (leftover habit from some other Java ORM tools) - I eventually gave up and now do it the 'Right Way' (tm)</p>\n\n<p>Eventually it would be nice (as JRoppert indicated) to have the generate databse schema from model feature - then you could get your DDLs for various DB flavours automagically.</p>\n"}, {'answer_id': 135215, 'author': 'Pop Catalin', 'author_id': 4685, 'author_profile': 'https://Stackoverflow.com/users/4685', 'pm_score': 0, 'selected': False, 'text': '<p>Generating databases from model is a feature planned for vNext of Entity Framework. \nCheck out this <a href="http://blogs.msdn.com/efdesign/archive/2008/09/10/model-first.aspx" rel="nofollow noreferrer">blog post</a> of <a href="http://blogs.msdn.com/efdesign/default.aspx" rel="nofollow noreferrer">Entity Framework Design</a> explaining the planned features for database generation from a model. </p>\n\n<p>What you must do right now is either 1) generate the database by hand, or 2) parse the CSDL file and write your own generator. I think option 1) is probably a better option.</p>\n'}, {'answer_id': 5588739, 'author': 'Danijel Arsenovski', 'author_id': 69067, 'author_profile': 'https://Stackoverflow.com/users/69067', 'pm_score': 0, 'selected': False, 'text': '<p>Avilable in EF 4:\n<a href="http://blogs.msdn.com/b/efdesign/archive/2008/09/10/model-first.aspx" rel="nofollow">http://blogs.msdn.com/b/efdesign/archive/2008/09/10/model-first.aspx</a></p>\n'}]
['https://Stackoverflow.com/questions/60972', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2744/']