Search code examples
sql-servervisual-studio-2017sql-server-data-tools

changing collation settings in Visual Studio 2017


I've got a database project I'm working on in visual studio 2017. I've set the collation to be Latin1_General_CI_AS for the database but unfortunately when I do a debug build with a post execution script that merges values (in my script) into one of the tables I get the error "Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation."

The only thing I can think of is that script is being read with a collation from some setting is Visual Studio. I've checked the local database it has created and it has the Latin1_General_CI_AS collation. Is there a setting I can change in VS2017? Anyone have any other ideas?

Thanks


Solution

  • From what I have found the server collation cannot be changed in the localdb for SQL database projects in visual studio.

    From pmbAustin comment I was able to determine it was indeed a temp table causing the issue. I've set the collation for the text columns in that temp table to use the database default and this has resolved the issue.

    Thanks