Solved

windows NT login and sql login

Posted on 2008-10-23
3
265 Views
Last Modified: 2013-12-23
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
Comment
Question by:countrymeister
  • 2
3 Comments
 
LVL 20

Expert Comment

by:Marten Rune
ID: 22785787
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
 
LVL 1

Author Comment

by:countrymeister
ID: 22830655
I have an acoubnt in the db as execTestReportAdmin, I want to change this to exeRptAdm
0
 
LVL 20

Accepted Solution

by:
Marten Rune earned 500 total points
ID: 22833824
The code attached should do this!
use [dbnamehere]

GO

ALTER USER [execTestReportAdmin]

WITH

NAME = exeRptAdm

Open in new window

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now