How to create a database from individual scripts?

A project I am working on is storing each database object (tables, store procedures, etc) in its own file in source control, TFS. I am thinking about implementing a workflow that will build the database in a Windows Azure SQL Server VM instance tied to TFS commits that will run tests for continuous integration.

How does one reconstruct the database from these individual files? Since there are dependencies to consider among other things, is there a standard practice on how to construct a database with needed structure when the objects are stored in individual files?

I am thinking that file by file might not actually be a realistic way to do this? If this is the case, do some companies keep an empty database in the testing domain to be filled with data for CI purposes and not drop the database during test tear down?

Answers


Sounds like your team had a SQL Server Database Project at some point. If it's not there, you can create one, and include the individual script files in the appropriate folder in the SQL Server Database Project.

Then all you have to do is right click and deploy to whichever environment you want to deploy the database to.

Here's more: CREATING A SQL SERVER DATABASE PROJECT IN VISUAL STUDIO 2012.


Need Your Help

Hide everything on dom until everything is loaded

javascript jquery dom

I am trying to change the content of a div on the page but the page has a lot of things to load and on slower computers there is a flicker where you can see the div changing (changing through jquer...

Get parent variable in child controller

php cakephp http-redirect

I have Lessons that belong to Courses. I want an added lesson to redirect to that lesson's course index instead of the overall Lessons index.