0

Is it possible to pass a parameter(date) to the location of the Azure Synapse External Table?

LOCATION='/Windows/Folder/File_name_yyyy-MM-dd.csv'

I want to parameterise yyyy-MM-dd and File_name_yyyy-MM-dd.csv as a parameter which changes every day. I tried all below, but nothing allows me to create the table due to syntax errors -

LOCATION->'/Windows/Folder/File_name_'format(getdate(),'yyyy-MM-dd')'.csv'
LOCATION->'/Windows/Folder/File_name_'{format(getdate(),'yyyy-MM-dd')}'.csv'
LOCATION->'/Windows/Folder/File_name_'@{format(getdate(),'yyyy-MM-dd')}'.csv'
Vivek KB
  • 49
  • 6
  • No. You could use dynamic SQL to achieve similar effect. – wBob Aug 08 '22 at 14:14
  • Are you able to help me out here, if you have an example for this scenario using Dynamic SQL? – Vivek KB Aug 08 '22 at 14:56
  • 1
    Yes, of course! You should read this article on [The Curse and Blessings of Dynamic SQL](https://www.sommarskog.se/dynamic_sql.html) and then you will be ready! – wBob Aug 08 '22 at 18:16

0 Answers0