Share via

Create External SQL Table - Failed to Detect Schema

Aaron Gray 20 Reputation points
2025-01-22T19:15:37.78+00:00

This is the first time I have come across this issue. I put a CSV file in our storage and then try to create an external table. Here is the error I get:

User's image

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.

Azure Data Factory
Azure Data Factory

An Azure service for ingesting, preparing, and transforming data at scale.

0 comments No comments

Answer accepted by question author

Amira Bedhiafi 42,941 Reputation points MVP Volunteer Moderator
2025-01-22T21:57:55.12+00:00

You can define the schema manually during the table creation :

CREATE EXTERNAL TABLE [your_table_name] (
    Column1 INT,
    Column2 NVARCHAR(50),
    Column3 DATETIME
    -- Add more columns as required
)
WITH (
    LOCATION = '/path/to/csv/file',
    DATA_SOURCE = [your_external_data_source],
    FILE_FORMAT = [your_file_format]
);

Here is an old thread : https://learn.microsoft.com/en-us/answers/questions/1367973/how-to-fix-failed-to-detect-schema-error-when-impo

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.