“Alter User with login” equivalent in SQL2000

By now, most DBA’s must be familiar with “Alter user with login” command from SQL 2005 SP2 and above. But when only SQL 2000 existed we had to do a lot more things manualy. Migrating logins/users has always been a pain, but at least MS had a few built-in procedures to make our life easier.

The equivalent of “Alter user” in 2000 is “sp_change_users_login”. Bellow you have an exemple extracted from this great post.

--Lists usernames that are not mapped to logins
exec sp_change_users_login 'report'
--Map db username to server login if names match
exec sp_change_users_login 'update_one', 'username'
--Maps db username to server login if names match,
--If no login exists, it creates one with the password given.
exec sp_change_users_login 'auto_fix', 'username' , 'password'

cya!

Advertisements

About mauriciorpp

Hi, I am Piccolo - but not the one from Dragon Ball. I'm from a highly competitive and fast-paced world too, the IT industry, and this space will be used to share some challenges I face daily on my career. As you will see, I don't do brawls but I need to be a fighter! Stay tuned.
This entry was posted in SQLServer and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s