Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm not asking how to change the user's login, which is doable with sp_change_users_login, but really the user's name (which comes under the Name column of the list of users in Enterprise Manager).

Is there a stored procedure to do it? Some other command?

share|improve this question

migrated from stackoverflow.com Mar 14 '12 at 14:48

This question came from our site for professional and enthusiast programmers.

    
What "list of users"? Are you trying to change the login name at the server level, or the user name within a database? These are two different things that are often the same but don't need to be. –  Aaron Bertrand Mar 12 '12 at 20:16
    
I recommend the DBA stack. –  pst Mar 12 '12 at 20:18
    
Hey @AaronBertrand. I figured you might pick this up. I don't mean the login. I mean a user name within a database. –  MPelletier Mar 12 '12 at 20:21
    
Oh, but I wish there was a move to dba option now... –  MPelletier Mar 12 '12 at 20:37
    
Well you could always delete your question and create one there. Did you try the answer I posted? I suspect it wasn't valid in 2000 (since that was before the major schema shift in 2005) but thought I would throw it out there just in case. –  Aaron Bertrand Mar 12 '12 at 20:38

1 Answer 1

up vote 0 down vote accepted

I don't have a 2000 instance handy to test right now, but could it be as simple as:

ALTER USER foo WITH NAME = bar;

(I honestly forget if this syntax was valid in SQL Server 2000.)

share|improve this answer
    
That's the thing, in SQL Server 2000 I get "Incorrect syntax near the work 'USER'." –  MPelletier Mar 12 '12 at 20:38
    
Yeah I wasn't too confident it was valid then. You may have to drop the user and re-create them. –  Aaron Bertrand Mar 12 '12 at 20:39
    
Yeah, I'll just drop 'em. It really doesn't seem supported in 2000. –  MPelletier Mar 12 '12 at 20:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.