I work in a project and I try to automate everything so I just need to automate the deployment of the project including the DB with the CI (continuous integration) to QA machine or Testing environment so the scenario start with the developer try to check-in his code so the team build start build the project and when he succeeded it will deploy the website to the Testing web server and deploy the DB to the Testing DB server, to keep my article simple I will just describe the part of the DB only so I will separate it from the rest of the project
Edit the properties of the DB project in the deployment tab so it will deploy script and create the DB
Check-out any process template from the process template folder
Copy the file an rename it to the name you want
Add the file to the source control and check-in it after rename it
open the new file
Delete all steps, arguments and variables
Add sequence task and a MS Build task inside the sequence from the tool box
Start adding the following argument as the following image
Save the file
Check-in the file
To keep my article simple I will do this step manually, copy your DB project folder to the Team Build machine folder
Start create new build definition from the new process file and give this build definition the need parameter and one of them is the path of the DB project on the Team build server
Queue and build using the created build definition
check your DB.
Done.
You can download the process template files and the parameters value by clicking here