[英]How to connect database to data files in Azure Blob?
This resource states that a Azure SQL database may be attached to a database by using the following command: 该资源声明可以使用以下命令将 Azure SQL 数据库附加到数据库:
WITH IDENTITY='SHARED ACCESS SIGNATURE',
SECRET = '<your SAS key>'
CREATE DATABASE testdb
ON
( NAME = testdb_dat,
FILENAME = 'https://testdb.blob.core.windows.net/data/TestData.mdf' )
LOG ON
( NAME = testdb_log,
FILENAME = 'https://testdb.blob.core.windows.net/data/TestLog.ldf')
This results in Syntax Error near "ON".这会导致“ON”附近出现语法错误。 What is the issue here?
这里的问题是什么?
To connect Azure SQL Database to Azure blob storage, you need to create an external data source with the database scoped credentials.要将 Azure SQL 数据库连接到 Azure blob 存储,您需要使用数据库范围的凭据创建外部数据源。
CREATE DATABASE SCOPED CREDENTIAL BlobCred
WITH
IDENTITY = 'SHARED ACCESS SIGNATURE',
SECRET = 'SAS token' ;
CREATE EXTERNAL DATA SOURCE BlobStg
WITH
( LOCATION =‘https://storagename.blob.core.windows.net’,
CREDENTIAL = BlobCred,
TYPE = BLOB_STORAGE
) ;
Refer to official documents this & this for more details.有关详细信息,请参阅官方文档this & this 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.