windows NT login and sql login

I had to create new windows NT logins , so I created an account with the following execTestReportAdmin, and requested that I can access a database dbActivity

Then I requested that this user name be renamed as it was too long and was causing problem in storing this value in one of the tables
So the  nT group renamed it to exeRptAdm, but now when I log in to SQL Server, using this account and do
select user

I see the old login execTestReportAdmin
Can you please what needs to be done, because I need to see exeRptAdm
LVL 1
countrymeisterAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Marten RuneConnect With a Mentor SQL Expert/Infrastructure ArchitectCommented:
The code attached should do this!
use [dbnamehere]
GO
ALTER USER [execTestReportAdmin]
WITH
NAME = exeRptAdm

Open in new window

0
 
Marten RuneSQL Expert/Infrastructure ArchitectCommented:
This is not neccecarily a problem. You can 'aliasname' a nt account in the database security part. In the server part it's named with its true name. Do you need to rename the account? Im not sure I understand your question. But if a rename is all you want to do then this should do the trick.

ALTER USER [execTestReportAdmin]
WITH
NAME = exeRptAdm

as always, do a backup of the DB before you run any code you dont fully understand. If applicable, run in a test scenario first!

/Marten
0
 
countrymeisterAuthor Commented:
I have an acoubnt in the db as execTestReportAdmin, I want to change this to exeRptAdm
0
All Courses

From novice to tech pro — start learning today.