Solved

windows NT login and sql login

Posted on 2008-10-23
3
266 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

867 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

15 Experts available now in Live!

Get 1:1 Help Now