Re: Adding a database user
From: Dan Guzman (danguzman_at_nospam-earthlink.net)
Date: 05/29/04
- Next message: Dan Guzman: "Re: Cross-Database View Permissions"
- Previous message: Shrikant Patil: "how to write a trigger to trace a file activity?"
- In reply to: Steve Caliendo: "Adding a database user"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Sat, 29 May 2004 09:31:49 -0500
To add to the other responses:
Use sp_addlogin to add a new SQL login.
Use sp_grantlogin to grant an existing Windows account access to SQL Server
Use sp_grantdbaccess to add a SQL login or Windows account as a database
user
For example:
EXEC sp_addlogin 'MySqlLogin', 'MyPassword'
EXEC sp_grantlogin 'MyDomain\MyAccount'
USE MyDatabase
EXEC sp_grantdbaccess 'MySqlLogin'
EXEC sp_grantdbaccess 'MyDomain\MyAccount'
See the Books Online for details.
-- Hope this helps. Dan Guzman SQL Server MVP "Steve Caliendo" <scaliendo@epion.com> wrote in message news:e4Rvg8NREHA.1308@TK2MSFTNGP10.phx.gbl... > Hi, > > Could someone please tell me how to add a database user using a query? I > know how to set the appropriate permissions for tables of existing users, > but I can't figure out how to add a new user. > > Thank you, > > Steve > >
- Next message: Dan Guzman: "Re: Cross-Database View Permissions"
- Previous message: Shrikant Patil: "how to write a trigger to trace a file activity?"
- In reply to: Steve Caliendo: "Adding a database user"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|