Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Automatic new user creation

Author  Topic 

rajk
Starting Member

20 Posts

Posted - 2003-08-13 : 01:15:47
I am working on a project where we are trying to automate user, login id creation for a database, based on their network (Windows 2000) id. When we create a new employee record, a database user (and a login if required) should be created in the database and allocated to a particular role. Adding a user to a role is fine. Is there a way to create a login and/or database user automatically (by running an SP or something like that)

Thanks in advance
Raj

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2003-08-13 : 01:21:57
Have you looked at sp_addlogin in BOL?

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-08-13 : 01:36:35
Ummm

That is what Windows Authentication does already. Why don't you want to use that ?


Damian
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-08-13 : 12:29:47
Instead of adding accounts to SQL Server, just create a Windows group and add that to SQL Server and provide the permissions to the group. Then all that you have to do is add the accounts to the Windows group instead of adding them to SQL Server. If you need people to have different permissions, then you could create multiple groups. But, as rrb mentioned, sp_addlogin is what you need to add the group/accounts to SQL Server. You will then need to add it to a database and then provide permissions. sp_grantdbaccess will add the group/accounts to the database. GRANT will provide permissions.

Tara
Go to Top of Page
   

- Advertisement -