locked
Attempts to import a bacpac file into local SQL Server results in collation mismatch error RRS feed

  • General discussion

  • Hi,

      This is my first time using TechNet to ask a question instead of just browsing for an answer.  I can't find a good explanation for what I am seeing with this error message:

    TITLE: Microsoft SQL Server Management Studio
    ------------------------------

    Could not import package.
    Warning SQL72012: The object [censored] exists in the target, but it will not be dropped even though you selected the 'Generate drop statements for objects that are in the target database but that are not in the source' check box.
    Warning SQL72012: The object [censored] exists in the target, but it will not be dropped even though you selected the 'Generate drop statements for objects that are in the target database but that are not in the source' check box.
    Error SQL72014: .Net SqlClient Data Provider: Msg 468, Level 16, State 9, Procedure CensoredViewName, Line 12 Cannot resolve the collation conflict between "Latin1_General_100_CI_AS_KS_WS_SC" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.
    Error SQL72045: Script execution error.  The executed script:
    CREATE VIEW [censored].[CensoredViewName]
    AS
    SELECT t.object_id AS TableID,
           t.name AS TableName,
           c.name AS ColumnName,
           (CASE WHEN a.ColumnName IS NULL THEN 0 ELSE 1 END) AS Selected
    FROM   sys.tables AS t
           INNER JOIN
           sys.columns AS c
           ON t.object_id = c.object_id
           LEFT OUTER JOIN
           CensoredTableName AS a
           ON a.TableName = t.name
              AND a.ColumnName = c.name;


     (Microsoft.SqlServer.Dac)

    ------------------------------
    BUTTONS:

    OK
    ------------------------------

    The two columns I know for a fact are the exact same collation in the original database, and the destination is of the same collation, so how can there be conflict?  What is changing the collation of my columns during import?  I presume that it has something to do with the table being joined to the sys.tables, but I cannot figure out what is happening on my own.  The database being exported is an Azure Database if that means anything.

    Thanks.

    Monday, February 4, 2019 11:07 PM