use master go create login [fred] from windows with default database=[master] go use demo go create user fred for login fred go grant select on table to fred
Select allOpen in new window
create login [MYDOMAIN\sjwales] from windows with default database=[master]
create user sjwales for login [MYDOMAIN\sjwales]
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