Computers4me
asked on
How to create a User Account in Microsoft SQL Databse
Hi,
Can anyone explain how to creat A User Account in a SQL Database.
Can anyone explain how to creat A User Account in a SQL Database.
you can also right click on the database, and use the graphic user interface
ASKER
How would you Pass through an AD User account?
If my domain is MYDOMAIN and my account is sjwales it would be:
All of this can be done from the SSMS GUI as well as indicated by esskayb2d.
The username could then be anything, drop the domain from user if you want, for example.
and then assign appropriate permissions to sjwales as needed.
create login [MYDOMAIN\sjwales] from windows with default database=[master]
All of this can be done from the SSMS GUI as well as indicated by esskayb2d.
The username could then be anything, drop the domain from user if you want, for example.
create user sjwales for login [MYDOMAIN\sjwales]
and then assign appropriate permissions to sjwales as needed.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
First you have to create a login to the instance.
That can be a SQL Server account (with a password) or you take take the Windows AD login and pass that through.
Then you create a user in the database connected to that login and grant appropriate privileges.
Open in new window
The user name and the login name do not have to be the same. Make sure you grant object permissions to the user, not the login.
There are exceptions, for example you can make a login a system wide administrator for all databases on the instance.
From the documentation:
Creating a login: http://msdn.microsoft.com/en-us/library/aa337562.aspx
Creating a user: http://msdn.microsoft.com/en-us/library/ms173463.aspx