Solved

windows NT login and sql login

Posted on 2008-10-23
3
271 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how the fundamental information of how to create a table.

623 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