Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 273
  • Last Modified:

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
0
countrymeister
Asked:
countrymeister
  • 2
1 Solution
 
Marten RuneCommented:
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
 
Marten RuneCommented:
The code attached should do this!
use [dbnamehere]
GO
ALTER USER [execTestReportAdmin]
WITH
NAME = exeRptAdm

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now