执行OPENROWSET(BULK)/Azure SQL数据库时出错 [英] error executing OPENROWSET (BULK) / Azure SQL Database

查看:142
本文介绍了执行OPENROWSET(BULK)/Azure SQL数据库时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用"Active Directory-集成"身份验证登录到Azure SQL数据库,其中仅提供公司域凭据;没有密码.

I am logged into an Azure SQL Database, using "Active Directory - Integrated" authentication wherein I supply my company domain credentials only; no password.

我尝试对存储在客户端(笔记本电脑)上的.json文件执行OPENROWSET:

I tried executing OPENROWSET on a .json file stored on my client (laptop):

Select BulkColumn
from OPENROWSET
(BULK 'C:\Users\username\Downloads\docs_by_day_IncludeDocs.json',
SINGLE_CLOB) as my_test

返回了:

Msg 4861, Level 16, State 1, Line 12
Cannot bulk load because the file "C:\Users\username\Downloads
\docs_by_day_IncludeDocs.json" could not be opened.
Operating system error code (null).

此错误与尝试连接到本地客户端的Azure SQL数据库有关吗?与其他张贴者不同,该错误消息并未明确标识访问问题.

Does this error have something to do with Azure SQL Database trying to connect to my local client? Unlike some other posters, the error message does not explicitly identify an Access problem.

感谢您的协助!

推荐答案

SQLAZURE不知道该路径.

SQLAZURE has no idea of this path..

C:\Users\username\Downloads\docs_by_day_IncludeDocs.json

您将必须将文档上传到存储帐户,然后尝试以下操作

you will have to upload the doc to a storage account and try some thing like below

SELECT *
FROM OPENROWSET(BULK 'data/product.bcp', DATA_SOURCE = 'MyAzureBlobStorage',
 FORMATFILE='data/product.fmt', FORMATFILE_DATA_SOURCE = 'MyAzureBlobStorage') as data

在此之前,您需要创建一个存储帐户.

Prior to that, you will need to create a storage account..

CREATE EXTERNAL DATA SOURCE MyAzureBlobStorage
 WITH ( TYPE = BLOB_STORAGE,
        LOCATION = 'https://myazureblobstorage.blob.core.windows.net',
        CREDENTIAL= MyAzureBlobStorageCredential);

参考文献:
查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆