Using filepath() in synapse

Haoran Bai 80 Reputation points
2025-05-30T08:15:21.2033333+00:00

I created an extrenal table in synapse and try to use filepath function on it, but got below error:

User's image

Here is my table:

CREATE EXTERNAL TABLE bronze.trip_data_green_csv
    (
        VendorID INT,
        lpep_pickup_datetime datetime2(7),
        lpep_dropoff_datetime datetime2(7),
        store_and_fwd_flag CHAR(1),
        RatecodeID INT,
        PULocationID INT,
        DOLocationID INT,
        passenger_count INT,
        trip_distance FLOAT,
        fare_amount FLOAT,
        extra FLOAT,
        mta_tax FLOAT,
        tip_amount FLOAT,
        tolls_amount FLOAT,
        ehail_fee INT,
        improvement_surcharge FLOAT,
        total_amount FLOAT,
        payment_type INT,
        trip_type INT,
        congestion_surcharge FLOAT
    )  
    WITH (
        LOCATION = 'nyc-taxi-data/raw/trip_data_green_csv/year=*/month=*/green_tripdata_*.csv',
        DATA_SOURCE = nyc_taxi_src, 
        FILE_FORMAT = csv_file_format
    );

And here is my file format:

CREATE EXTERNAL FILE FORMAT csv_file_format
WITH
(  
    FORMAT_TYPE = DELIMITEDTEXT,
    FORMAT_OPTIONS (
      FIELD_TERMINATOR = ',', 
      FIRST_ROW = 2, 
      USE_TYPE_DEFAULT = FALSE,
      ENCODING = 'UTF8', 
      PARSER_VERSION = '2.0'
    )
);

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.
5,357 questions
{count} votes

Accepted answer
  1. Nandan Hegde 35,831 Reputation points MVP Volunteer Moderator
    2025-06-03T10:25:40.0233333+00:00

    You can use Select Location from sys.external_tables to get the file path details of external tables

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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