title: Azure Synapse Analysis: Error while accessing the external table
body: <p>Failed to execute query. Error: File '<a href="https://track2gen2storage.blob.core.windows.net/" rel="nofollow noreferrer">https://track2gen2storage.blob.core.windows.net/</a>\sourcedata\sample.csv' cannot be opened because it does not exist or it is used by another process.</p>
  
  <p>we performed these steps:-</p>
  
  <pre><code>create database SalesdataDemo
  use salesdataDemo
  -----create master key
  CREATE MASTER KEY ENCRYPTION BY PASSWORD = &lt;Password&gt;;
  SELECT *
  FROM sys.symmetric_keys AS SK
  WHERE SK.name = '##MS_DatabaseMasterKey##';
  
  CREATE DATABASE SCOPED CREDENTIAL ADL_User
  WITH
  IDENTITY = '&lt;client_id&gt;@&lt;OAuth_2.0_Token_EndPoint&gt;',Secret = &lt;Key&gt;
  
  CREATE DATABASE SCOPED CREDENTIAL adls_credential
  WITH IDENTITY ='SHARED ACCESS SIGNATURE',
  SECRET = &lt;azure_storage_account_key&gt;
  
  CREATE EXTERNAL DATA SOURCE adlsdatasource
  WITH
  ( LOCATION = 'https://track2gen2storage.blob.core.windows.net',
  CREDENTIAL = adls_credential
  ) ;
  
  CREATE EXTERNAL FILE FORMAT adls_csv
  WITH (
  FORMAT_TYPE = DELIMITEDTEXT,
  FORMAT_OPTIONS ( FIELD_TERMINATOR = ',', STRING_DELIMITER = '"', FIRST_ROW = 2 )
  );
  
  
  CREATE EXTERNAL TABLE sampledata ( &lt;ColumnName&gt;&lt;Datatype&gt;)
  WITH (
  LOCATION = '/sourcedata/sample.csv',
  DATA_SOURCE = adlsdatasource,
  FILE_FORMAT = adls_csv
  )
  
  select * from sampledata
  </code></pre>