CREATE DATABASE SCOPED CREDENTIAL
defines a database scoped credential
What changes
- Input
- catalog
- Output or change
- security catalog: database scoped credential
Syntax at a glance
CREATE DATABASE SCOPED CREDENTIAL credential_name WITH IDENTITY = 'identity_name' [ , SECRET = 'secret' ] [ ; ]
Work example
A database-scoped feature needs an external identity without an instance-wide credential.
Match the credential to its external data source and verify secret rotation with the owning team.
Check your work Only the intended database feature can use the credential and no secret appears in a script.
Open Microsoft Learn for full syntax, permissions, and details for your version.