| title | Granting Access to a Database | Microsoft Docs | |
|---|---|---|
| ms.custom | ||
| ms.date | 06/13/2017 | |
| ms.prod | sql-server-2014 | |
| ms.reviewer | ||
| ms.technology | ||
| ms.topic | conceptual | |
| helpviewer_keywords |
|
|
| ms.assetid | 686edfe2-3650-48a6-a2da-9d46fa211ad8 | |
| author | VanMSFT | |
| ms.author | vanto | |
| manager | craigg |
Mary now has access to this instance of [!INCLUDEssNoVersion], but does not have permission to access the databases. She does not even have access to her default database TestData until you authorize her as a database user.
To grant Mary access, switch to the TestData database, and then use the CREATE USER statement to map her login to a user named Mary.
-
Type and execute the following statements (replacing
computer_namewith the name of your computer) to grantMaryaccess to theTestDatadatabase.USE [TestData]; GO CREATE USER [Mary] FOR LOGIN [computer_name\Mary]; GONow, Mary has access to both [!INCLUDEssNoVersion] and the
TestDatadatabase.