Gotcha
I recently had to create some non-schema related objects for a database project I am working on. It caused an annoying problem with Red Gate SQL Compare where I was prompted each time I did the compare about “Non-Schema” scripts being ignored. On one hand I guess it is good it told me, on the other I was tired of seeing this repeatedly. I fixed the problem by doing the following.
Solution
Locate your target files and set them to Build Action None:
- Select target file
- Press F4 to bring up the properties window
- Select “None” from the drop down of the “Build Action” row
I then included these scripts as part of a pre-deployment script so that they would be created accordingly when running the VS SSDT publish. The result here is these objects won’t be deployed via SQL Compare, so you have to know your own process and make sure they are deployed somehow.
Object examples
You might be wondering “What kind of objects cause this?” so here is the context of what I was working with:
- Master Key
- Certificate
- Symmetric Key
Additional information
https://documentation.red-gate.com/sc10/troubleshooting/common-issues/errors-in-scripts-folders
https://forum.red-gate.com/discussion/15364/static-data-file-causes-non-schema-statement-was-ignored