How to export database schema in Visual Studio 2012?
It depends on what exactly you mean by your question. If you simply want to generate a create database / tables / views / and optionally include data, then you could use sql management studio (express, if need be) to generate scripts (via SMO) and then simply execute your script at runtime, alternatively i think you can generate scripts from the 'server explorer' tool window if you have a registered SQL server.
However, if you intend to version the database schema, and provide schema versioning/data versioning once a database is in place, they you'll want to look at SQL Server data tier applications, which is more of a toolset and libraries for database lifecycle management (buzzword overdrive enabled).
The tooling for VS data tier app projects is wrapped up in the SQL Server Data Tools, which basically adds a slimmed down version of SQL SMS object explorer to the project window when working with database projects, and adds some pretty awesome project configuration capabilities when compared to just executing a pre-generated SQL script at runtime.
Matt Fordham
Updated on June 15, 2022Comments
-
Matt Fordham about 2 years
I am having a hard time figuring out how to export a database creation script in VS 2012. Is this possible?