无法在SQL中创建外部数据源 [英] Can't CREATE EXTERNAL DATA SOURCE in SQL

查看:104
本文介绍了无法在SQL中创建外部数据源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个外部数据源来访问Azure Blob存储.但是,我在创建实际数据源时遇到问题.

I'm trying to create an external data source to access Azure Blob Storage. However, I'm having issues with creating the actual data source.

我已按照此处的说明进行操作: 在azure blob存储中批量访问数据的示例创建外部数据源-交易sql .我正在使用Windows身份验证的客户端计算机上通过SSMS访问的VM上使用SQL Server 2016,没有任何问题.说明说,创建此外部数据源适用于SQL Server 2016和Azure Blob存储.

I've followed the instructions located here: Examples of bulk access to data in azure blob storage and Create external data source - transact sql. I'm using SQL Server 2016 on a VM accessing via SSMS on a client machine using Windows Authentication with no issues. Instructions say creating this external data source works for SQL Server 2016 and Azure Blob Storage.

我已经创建了主密钥:

CREATE MASTER KEY ENCRYPTION BY PASSWORD = <password>

,并且数据库范围凭证

CREATE DATABASE SCOPED CREDENTIAL UploadCountries  
WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
SECRET = <key>;

我已经通过查询sys.symmetric_keys和sys.database_scoped_credentials验证了这两种数据库中的存在.

I have verified both of these exist in the database by querying sys.symmetric_keys and sys.database_scoped_credentials.

但是,当我尝试执行以下代码时,它说'EXTERNAL'附近的语法不正确

However, when I try executing the following code it says 'Incorrect syntax near 'EXTERNAL'

CREATE EXTERNAL DATA SOURCE BlobCountries
WITH  (
    TYPE = BLOB_STORAGE,
    LOCATION = 'https://<somewhere>.table.core.windows.net/<somewhere>', 
    CREDENTIAL = UploadCountries  
);

感谢您的想法和帮助!

史蒂夫.

推荐答案

在"

In "Examples of Bulk Access to Data in Azure Blob Storage", we can find:

从SQL Server批量访问Azure blob存储至少需要SQL Server 2017 CTP 1.1.

Bulk access to Azure blob storage from SQL Server, requires at least SQL Server 2017 CTP 1.1.

并在"

And in Arguments section of "CREATE EXTERNAL DATA SOURCE (Transact-SQL)", we can find similar information:

在SQL Server 2017中使用BULK INSERT或OPENROWSET执行批量操作时,请使用BLOB_STORAGE

Use BLOB_STORAGE when performing bulk operations using BULK INSERT or OPENROWSET with SQL Server 2017

您正在使用SQL Server 2016,因此在为Azure Blob存储创建外部数据源时出现Incorrect syntax near 'EXTERNAL'错误.

You are using SQL Server 2016, so you get Incorrect syntax near 'EXTERNAL' error when you create external data source for Azure Blob storage.

这篇关于无法在SQL中创建外部数据源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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