We are using database projects to deploy our databases. In the project settings, we have specific a Project Version (version of target SQL Server) and a Collation for Data model.
However, when I deploy it, I get the following error
TSD00560 The project and target databases have different collation settings. Deployment errors might occur.
This happens when we are deploying in upgrade mode. My question is, is there any way to read Model Collation from a deployed database?
We are using VSDBCMD for deployment
You can use VSDBCMD to generate the model from the database using:
vsdbcmd.exe /Action:Import
In the schema file (output) you got a tag named DataSchemaModel that has a property called CollationLcid that displays the model setting of the target database.
I do not know any property on the target database you can retrieve, maybe this can be done using the Microsoft schema libs.