How to create External table with different collation

Mallikarjuna Avula 1 Reputation point
2022-07-25T14:48:21.027+00:00

Please confirm can we create a External table with Different collation on Azure Synapse Database. Can we have different collation on object level ?

Azure Synapse Database collation : Default (SQL_Latin1_General_CP1_CI_AS)
Expected Table creation with Collation : Latin1_General_100_CI_AI_SC_UTF8

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,471 questions
{count} votes

1 answer

Sort by: Most helpful
  1. BhargavaGunnam-MSFT 27,566 Reputation points Microsoft Employee
    2022-07-25T20:53:17.44+00:00

    Hello @Mallikarjuna Avula ,

    Thanks for the question and using MS Q&A platform.

    Sorry, you can't create external tables with a different collation on the table level, collation is only applicable on the column level in the external tables.

    Please see the below example for your reference.

    USE [mydbname];
    GO
    CREATE EXTERNAL TABLE populationExternalTable
    (
    [country_code] VARCHAR (5) COLLATE Latin1_General_100_CI_AI_SC_UTF8,
    [country_name] VARCHAR (100) COLLATE Latin1_General_100_CI_AI_SC_UTF8,
    [year] smallint,
    [population] bigint
    )
    WITH (
    LOCATION = 'csv/population/population.csv',
    DATA_SOURCE = sqlondemanddemo,
    FILE_FORMAT = QuotedCSVWithHeaderFormat
    );

    Also please see this documentation for more details on the external table syntax

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    1 person found this answer helpful.
    0 comments No comments