简体   繁体   中英

Azure SQL blob storage select

I am attempting to create a temp table to store the values of an xlsx file on my azure blob storage, I have followed numerous Microsoft articles now and I am under the impression that I should be using SELECT * FROM OPENROWSET() , this seems to be working or at least selecting something.

Here is my code:

SELECT * INTO ##TempTest FROM OPENROWSET(BULK  'test.xlsx',
   DATA_SOURCE = 'DevStoreAccount', SINGLE_CLOB) AS a;

SELECT * FROM ##TempTest

This all runs fine, but the output is not what I am expecting , surely this should return all my columns / rows from the excel file? Or am I mistaken?

The above code returns the following:

在此处输入图片说明

What exactly is it returning and should I be doing something different? Any help would really be appreciated.

I'm trying this route as the columns in the excel file could change at any time, so I need to dynamically create my tables.

I'd recommend checking this thread , although the post is old, it is still relevant to your question. The approach taken for the similar scenario:

1- Create and update Excel file using Open XML SDK

2- Upload Excel Template in Azure BLOB

3- Download Excel template in azure web role local storage

4- Read and update excel file from azure web role local storage

5- Upload updated excel in Azure BLOB.

II You could also use another similar concept as mentioned here

  1. Downloading excel file as Stream from BLOB

  2. Creating Excel document using Open XML SDK

  3. After edit saving doc to Stream

  4. Uploading back the Stream to BLOB

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM