I am trying to create a table in my Azure SQL Database, based off files uploaded in a blob storage directory (in JSON format). The schema needs to be the dynamic and be based off the file at the directory at the time e.g. schema could be varchar(3),int,float in one instance, in another it could be varchar(4),int,int,int.
Is there any solution to this using ADF? (and or stored procedures?). I've looked everywhere, and no one seems to have solved this exact problem.
I've tried using Get Meta Data activity and passing that into a stored procedure, but that doesn't solve the problem of the dynamic schema.
1条答案
按热度按时间hk8txs481#
If we use
auto create table
option inside copy activity - sink tab, then it will automatically creates table Azure SQL.But in your case, it seems schema you want to have control. For that, try to have schema stored at some file and then read in ADF using
lookup activity
. And inside Sink tab of copy activity, inpre-copy script
option, use that schema before load of file. This creates table first and then loads data in to it.