Azure Synapse - Script parameter for External Table Location

Lukas 151 Reputation points
2022-09-13T12:19:28.437+00:00

Hello Microsoft Q&A,

I have the following problem: Inside a Azure Synapse Pipeline, I'm using a script to create an External Table in a serverless sql pool. I tried to use a script parameter to parameterize the LOCATION of the External Table:

240601-image.png

But I get the following error:

"errorCode": "2011",  
"message": "Incorrect syntax near '@location'.",  
"failureType": "UserError",  

Is it possible to use the script parameter to specify the LOCATION inside a create external table statement?

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,921 questions
0 comments No comments
{count} votes

Accepted answer
  1. Nandan Hegde 32,421 Reputation points MVP
    2022-09-13T12:51:19.557+00:00

    Hey,
    Can you please try the below code

    CREATE EXTERNAL TABLE [ExtPB].[Test]  
      
    (  
    	 c1 int,  
    c2 int  
    )  
    WITH  
    (  
    	 DATA_SOURCE = [BlobStorage]  
    	,LOCATION = N'@{pipeline().parameters.Location}'   
    	,FILE_FORMAT = [PipeDelimited]  
    	,REJECT_TYPE = VALUE  
    	,REJECT_VALUE = 0  
    )  
      
    

1 additional answer

Sort by: Most helpful
  1. Joshua Matthews 6 Reputation points
    2023-04-21T18:06:02.1133333+00:00

    Did you ever figure out how to use a script parameter?

    0 comments No comments

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.