We have seen so many scenario when we need to Alter login to change a password but in very rare cases we Alter a Login means rename a Login.
Today i got one request related to create a SQL Account like VPUSER and i created the user with same name and tell that its done.
After a while he again requested can you please delete this user and create new user with the name of [VPAPPUSER] .When i asked the exact requirement why he wants to delete old user and create new one so he explained me the SQL Login account should be according of naming convention .
Then i thought i will not delete the login i will alter the login if i delete the login then i have to do lot of things after creation login like need to give all permission again.
So i Alter the Login and User as well with following command and i saved all the time .
ALTER LOGIN VPUSER WITH NAME = [VPAPPUSER];
If you will not change the User name it will work as it is but user name will be different. It will be better if naming convention should be same
ALTER USER VPUSER WITH NAME = [VPAPPUSER];
Today i got one request related to create a SQL Account like VPUSER and i created the user with same name and tell that its done.
After a while he again requested can you please delete this user and create new user with the name of [VPAPPUSER] .When i asked the exact requirement why he wants to delete old user and create new one so he explained me the SQL Login account should be according of naming convention .
Then i thought i will not delete the login i will alter the login if i delete the login then i have to do lot of things after creation login like need to give all permission again.
So i Alter the Login and User as well with following command and i saved all the time .
ALTER LOGIN VPUSER WITH NAME = [VPAPPUSER];
If you will not change the User name it will work as it is but user name will be different. It will be better if naming convention should be same
ALTER USER VPUSER WITH NAME = [VPAPPUSER];