Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rename User

Status
Not open for further replies.

Alexisss

MIS
Sep 29, 2003
14
0
0
US
SQL7.0 I need to change a username to the user's new married name. I already renamed the account in the domain but it didn't change in SQL. I don't see where I would change this in SQL - is it possible?
 
Check out sp_change_users_login in BOL. Specifically the second example at the bottem.

This example changes the link between user Mary in the pubs database and the existing login, to the new login NewMary (added with sp_addlogin).

--Add the new login.
USE master
go
EXEC sp_addlogin 'NewMary'
go

--Change the user account to link with the 'NewMary' login.
USE pubs
go
EXEC sp_change_users_login 'Update_One', 'Mary', 'NewMary'


I know it works in 2k, but not sure if it was in 7. fairly sure it was though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top