0
votes

SQLState = S1000, NativeError = 0 Error = [Microsoft][ODBC SQL Server Driver 13]Unable to resolve column level collations

I have researched in google and have not seen a solution. The BCP works and then says copying. It even creates the text file. Then I get the above error and the text file is left empty.

I had sql server 2014 and sql server 2012 express installed on my machine and the server that the BCP is importing is SQL Server 2008.

This is my first question on Stack Overflow. I am a long time reader though.

1
Hello you down voters. There should be no down vote without a comment... - Shnugo
Can you include your query, the design of the tables it uses and the collation of each text column? - David Rushton
The problem is fixed. I deleted all installations of SQL Server including a SQL server 2016 part installation. I installed 2008r2 SQL Server. The query worked fine. I understand that collations come in to effect when going from database to database. The error was confusing as it was ambiguous as to whether it was a query error or a driver error. I was going from SQL Server to a text file. The query had unions in it. When I just did the query for a single select it worked. But when I did it for the select with union I got the above error. - Darren
But after the new single selection of SQL Server 2008r2 Express it works. I can not publish the BCP command with the query or the tables because they are sensitive. I thank you for your interest in my first StackOverflow question. Any constructive criticism would be welcome. - Darren
Hi, for me your question was OK, up-voted it (not really because its extraordinarily good but more to react against the commentless down votes). Keep in mind, that someone who is not sitting close to you cannot know what is wrong. But - to be honest - such problems cannot be articulated perfectly as you didn't even had an idea what's going on... The only hint I have for you (more to my own concern): Please read this: someone-answers - Shnugo

1 Answers

1
votes

Collations come into effect, whenever you try to sort, filter or join textual data (e.g. varchar).

This can be due to

  • a specified collation in your script
  • differing collations in the table columns you are querying
  • differing collations in the databases (if you query against more than one database)
  • and last but not least! a differing collation of the server itself. This means, that created temp tables (either CREATE TABLE #tbl ... or SELECT * INTO #tbl ...) will use a "wrong" collation as default.