I'm trying to create a scoped credential in azure SQL using SSMS.
CREATE DATABASE SCOPED CREDENTIAL [cred-name] WITH IDENTITY = [db-user], SECRET = 'password'
I keep running into the error message stating "Incorrect syntax near 'cred-name'. Expected '='." I'm not sure how my syntax is incorrect as I've done this exact command successfully in the past so I'm not sure what has changed. I thought maybe it was just intellisense that was messing up so I updated my SSMS instance from 17.3 to 17.7 but I still get the same error message.
Does anyone have any idea of what could have changed?
Running the exactly T-SQL you posted against Microsoft SQL Azure (RTM) - 12.0.2000.8 May 4 2018 13:05:56 version leads to the following error:
Replacing the identity name brackets for single quotes leads to the error below:
Creating the master key with following T-SQL allows me to create the credential successfully:
Also, you can check if the scoped credential using the following query:
I'm using SSMS version 17.2, but I'm not sure if this matters since errors would come from the SQL Server engine itself.