0

I have a Serverless SQL pool set up in Azure Synapse Analytics, and I am trying to run this query:

 CREATE DATABASE SCOPED CREDENTIAL myCredential
    WITH IDENTITY = 'test',
        SECRET = 'test2';

When I run the query I get this error: Incorrect syntax near 'IDENTITY'.

How can I correct this issue?

Agneum
  • 727
  • 7
  • 23

1 Answers1

0

Please use the below format :

USE [master]  
GO  
  
-- Create the lake house logic database  
IF db_id('nyctaxidwdelta') IS NULL   
EXEC('CREATE DATABASE nyctaxidwdelta COLLATE Latin1_General_100_BIN2_UTF8')  
GO  
  
USE [nyctaxidwdelta]  
GO  
  
-- Create a master key  
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'blabla!'  
  
  
GO  
-- Create database scoped credential that use Synapse Managed Identity   
CREATE DATABASE SCOPED CREDENTIAL WorkspaceIdentity  
WITH IDENTITY = 'Managed Identity'  
GO  
  
-- Create external data source   
IF NOT EXISTS (SELECT * FROM sys.external_data_sources WHERE name = 'eds_nyctaxi')   
 CREATE EXTERNAL DATA SOURCE [eds_nyctaxi]   
 WITH (  
 LOCATION   = 'https://mystorage.dfs.core.windows.net/lakedata/',  
        CREDENTIAL =  WorkspaceIdentity    
 )  
GO  
CHEEKATLAPRADEEP
  • 12,191
  • 1
  • 19
  • 42
Nandan
  • 3,939
  • 2
  • 8
  • 21