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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-11-18 : 08:31:53
|
| Terry Ward writes "With Transact-SQL, I would like to update all SQL logins with the Database Access name of ‘heat601’ and the Database Role as db_datareader and db_datawriter where login type equal to 'Windows User'.What stored procedures or functions can be use to accomplish the above task?" |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2002-11-18 : 12:40:32
|
| To add users to a role use sp_addrolemember. To change the default database use sp_defaultdb. You will need to loop through syslogins. |
 |
|
|
|
|
|