1

I've got a VS2008 database project, and I created a post-deployment script under Scripts > Post-Deployment, but it appears to be a no-op (even when I put syntax errors into the file, everything succeeds). The rest of the database deployment succeeds though (and it does create my tables). Any clues?

1 Answer 1

3

It sounds like you're just placing scripts in your post-deployment directory. You actually need to include them in your Script.PostDeployment.sql file. For example:

:r .\MyScriptName.sql
:r .\MySecondScript.sql

Not every script in the Post-Deployment folder just runs by default; in fact, only one can. By default, it's that Script.PostDeployment.sql file. You can change it if you want.

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

2 Comments

Yep - figured this out awhile ago but left the question open so someone could get the pts. Such a dumb design.
Yeah, I realized the question was a little old...sorry about that! Yeah, I totally agree that it's a little bizarre. It'd be nice if there was an option that would just run all the scripts in the folder.

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.