SQL 2005: Alter Login Problems

For an unknown reason, the alter user statement does not work for me. It always return error.

alter user my_user WITH LOGIN = my_login

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ‘my_login’.

I have to use the system procedure instead.

EXEC sp_change_users_login ‘Update_One’, ‘my_user’, ‘my_login’

Advertisements

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