2

Deploying SQL (SSDT) projects to SQL 2012 from TFS 2012 Visual Studio 2012 using the TFS build controller. All projects have successfully deployed and pushed Post Deploy scripts to the server. (this is a test server where we are testing the deployment of a migration from 2008 to 2012). I needed to recreate the job (which is in the post deployment script) so I asked the deployment manager to drop the job and re-run the deploy. The post deployment script did not run and was not included in the generated deployment sql on the TFS server.

9
  • Not sure what you're talking about when you talk about jobs and deployment managers. I deploy SSDT projects using SqlPackage.exe and DACPAC's Commented Mar 26, 2014 at 19:53
  • I have my environment set up so dev sql projects are on continuous deployment to the dev server and when I am ready to deploy to QA or DEV I deploy using the build manager on the TFS server. Commented Mar 27, 2014 at 20:40
  • Can you look inside the dacpac file generated to verify that it has a postdeploy sql file and that it's correctly populated? I don't recall seeing the post-deploy scripts not running nor an option to prevent that. Commented Mar 27, 2014 at 21:16
  • The dacpac file for that project has a Model.sql but not a PostDeply.sql -- however the source for that project has a script that is marked as Post Deployment. Other project's dacpac files contain both sql files. Commented Mar 28, 2014 at 17:02
  • I did see the related question that you helped with (stackoverflow.com/q/16981612/236348) and as a precaution did remove all comments from that script, but it still does not include the script in my deployment, or the DACPAC that is generated. Commented Mar 28, 2014 at 17:21

1 Answer 1

2

database Project not running Post Deployment scripts

See the linked question for the answer. I removed comments. When I did this the Build Action reverted to "None" I checked later and fixed this by setting to "Post-Deploy" and without the comments, it worked.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.