Users & Roles on home development machine VS work environment - ms-sqlserver
This is a discussion on Users & Roles on home development machine VS work environment - ms-sqlserver ; I have a question that I will try to pose as best I can. While working at home, and obviously not having the AD from our work environment... I am constantly updating the mappings to domain users after I push ...
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| While working at home, and obviously not having the AD from our work environment... I am constantly updating the mappings to domain users after I push a new ..mdf file up to our development machine from home. I am currently building a new application that will replace an existing one. The new app uses a SQL2005 backend. When I push a new version of the .mdf file to our work development machine, I need to remap the existing users to the DB and then add them to the roles they need to be in. I know there has to be a better way. Hopefully this is clear enough to convey my situation and question. Any help is very much appreciated. tia, ...bob |
|
#2
| |||
| |||
|
Bob To remap you can use the following ALTER USER uname WITH LOGIN = loginanme For roles, you will to script out all users before applying a new database select [Role] = r.name, [Member] = m.name from sys.database_role_members rm join sys.database_principals r on rm.role_principal_id = r.principal_id join sys.database_principals m on rm.member_principal_id = m.principal_id order by r.name, m.name "Bob" news:F99D2BD5-49AA-454A-B72D-3BA1CB5A6708@microsoft.com... >I have a question that I will try to pose as best I can. > > While working at home, and obviously not having the AD from our work > environment... > > I am constantly updating the mappings to domain users after I push a new > .mdf file up > to our development machine from home. > > I am currently building a new application that will replace an existing > one. > The new app uses a SQL2005 backend. > > When I push a new version of the .mdf file to our work development > machine, > I need to remap the existing users to the DB and then > add them to the roles they need to be in. I know there has to be a better > way. > > Hopefully this is clear enough to convey my situation and question. > Any help is very much appreciated. > tia, > ..bob > |
|
#3
| |||
| |||
|
Thanks Uri, This looks like just what I need. I appreciate the reply. "Uri Dimant" news:eDwXwkdMKHA.1312@TK2MSFTNGP05.phx.gbl... > Bob > To remap you can use the following > ALTER USER uname WITH LOGIN = loginanme > > For roles, you will to script out all users before applying a new > database > > select [Role] = r.name, [Member] = m.name > from sys.database_role_members rm > join sys.database_principals r on rm.role_principal_id = > r.principal_id > join sys.database_principals m on > rm.member_principal_id = m.principal_id > order by r.name, m.name > > > > "Bob" > news:F99D2BD5-49AA-454A-B72D-3BA1CB5A6708@microsoft.com... >>I have a question that I will try to pose as best I can. >> >> While working at home, and obviously not having the AD from our work >> environment... >> >> I am constantly updating the mappings to domain users after I push a new >> .mdf file up >> to our development machine from home. >> >> I am currently building a new application that will replace an existing >> one. >> The new app uses a SQL2005 backend. >> >> When I push a new version of the .mdf file to our work development >> machine, >> I need to remap the existing users to the DB and then >> add them to the roles they need to be in. I know there has to be a >> better way. >> >> Hopefully this is clear enough to convey my situation and question. >> Any help is very much appreciated. >> tia, >> ..bob >> > > |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
All times are GMT -4. The time now is 03:47 PM.



Linear Mode