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 Development (2000)
 Proper way to add a user and assign role

Author  Topic 

Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2006-08-11 : 22:27:24
If I want to add a new user to the connected database what is the proper method in t-sql.

I need to add a login/Password/UserName/UserRole/ and that specific database(I do not want the user to be able to log into any other db)

Is there a single built in stored procedure to accomplish this, or what is the best way to do so.

Thanks

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-08-12 : 01:16:29
Read on BOL about sp_Addlogin

Chirag
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-08-13 : 21:49:26
after adding the login, you need to grant access to the database: sp_grantdbaccess

--------------------
keeping it simple...
Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-08-14 : 08:19:05
Or both of the above can be done, using built in interfaces, by using Enterprise Manager.

In EM, go to the Security branch and from there its self explanatory.
Can Create a Login (user) and grant access to the SQL server, DB , operations as Insert Update Delete, Tables & columns.....


Srinika
Go to Top of Page
   

- Advertisement -