SQL Change Automation: Build and synonyms
Awen
Posts: 5 New member
Hello,
following the creation of a synonym in our database (3-parts reference to another DB on the same server), our SQL Change Automation: Build pipeline is now failing with this error:
following the creation of a synonym in our database (3-parts reference to another DB on the same server), our SQL Change Automation: Build pipeline is now failing with this error:
##[error]1051 batches failed. The first error is 'Synonym '***' refers to an invalid object.'
This is the build definition in Azure DevOps (no deployment, the build is only there as a check), we are actually building a SQL Source Control project with it, which has been working fine until now:
Are there any tips on how to deal with synonyms when building SSC/SCA projects?
I found this old discussion on the same topic, that did not get any answer back then: Synonyms problems WARNING: The error 'Synonym 'sys_test' refers to an invalid object.' ... — Redgate forums (red-gate.com)
Thanks and regards,
Awen
This is the build definition in Azure DevOps (no deployment, the build is only there as a check), we are actually building a SQL Source Control project with it, which has been working fine until now:
Are there any tips on how to deal with synonyms when building SSC/SCA projects?
I found this old discussion on the same topic, that did not get any answer back then: Synonyms problems WARNING: The error 'Synonym 'sys_test' refers to an invalid object.' ... — Redgate forums (red-gate.com)
Thanks and regards,
Awen
Tagged:
Comments
I definitely recommend changing the operation to "Build a SQL Source Control project", if that's what you're actually doing.
The build task for SQL Change Automation projects has a check to validate three part names. That can be disabled by making changes in the SQL Change Automation project configuration file -- but you can't do things like that for SQL Source Control as it doesn't even have that file.
Hope this helps,
Kendra
does it means there is no way of solving that issue with a SSC project? I already had a look at migrating to a SCA project, but that's not such an easy change and definitely something that can be done in a few days.
I changed the build definition, but (as expected) the error is still there.
Thanks,
Awen
How would one go about disabling the validation in the SCA project? I am in the same situation but we are using SQL LocalDB on a self-hosted Agent. I have a synonym that points to another database that ultimately will be on the same server as the database being released. Thanks.