September 13, 2015 at 12:37 pm
Hi All,
What does the command do or what does it mean? When do we use it?
Alter login [<loginname>] with name = [<loginname>];
Thanks in advance.
September 13, 2015 at 12:52 pm
Say that you at some point run
CREATE LOGIN Hilary WITH PASSWORD = 'sdefhsdhhh'
And then you go on and grant permissions to this new employee. However, when this person turns up he/she is a little upset, because he/she spells the name with two l. This is when you run
ALTER LOGIN Hilary WITH NAME = Hillary
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
September 13, 2015 at 12:53 pm
vsamantha35 (9/13/2015)
Hi All,What does the command do or what does it mean? When do we use it?
Alter login [<loginname>] with name = [<loginname>];
Thanks in advance.
ALTER is a short-cut for DROP/CREATE, used whenever there is a need for changing the login, quicker and easier than writing two statements.
😎
September 13, 2015 at 12:54 pm
vsamantha35 (9/13/2015)
Hi All,What does the command do or what does it mean? When do we use it?
Alter login [<loginname>] with name = [<loginname>];
Thanks in advance.
The command changes a SQL Server login. The option name specifies the new name for the login. Essentially, it renames the login.
https://msdn.microsoft.com/en-us/library/ms189828%28v=sql.100%29.aspx
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply