SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Change the DBO login


Change the DBO login

Author
Message
Emilio.Mendoza
Emilio.Mendoza
SSC Rookie
SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)

Group: General Forum Members
Points: 48 Visits: 58
I need to change in a user database, the logn for the user DBO.
The requirement is to remove the actual SQL login for the NT Authority\Network Service login.

Is there a way to accomplish this?

Your help is very appreciate in this matter
nary
nary
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1739 Visits: 1449
USE Databasename
GO
Exec sp_changedbowner 'new login name'
ALZDBA
ALZDBA
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12097 Visits: 8924
e.g.
This one will map sqlaccount sa to the dbo user of your db.
Check BOL


exec sp_changedbowner 'sa', true



Johan


Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere w00t

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


press F1 for solution, press shift+F1 for urgent solution :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
Emilio.Mendoza
Emilio.Mendoza
SSC Rookie
SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)

Group: General Forum Members
Points: 48 Visits: 58
Thanks for the reply I've already use those options, probably I didn't explain myself correctly, I need to have the DBO name and the login 'NT AUTHORITY\NETWORK SERVICE' I have read smoe post where they say this can't be done, but I already checked some DB that shows exactly that. Crazy

SO it is possible but how can you do that to show in the NAME column DBO and the Login of the DB 'NT AUTHORITY\NETWOK SERVICE'?


Thanks for the help
Emilio.Mendoza
Emilio.Mendoza
SSC Rookie
SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)

Group: General Forum Members
Points: 48 Visits: 58
Emilio.Mendoza (9/10/2008)
Thanks for the reply I've already use those options, probably I didn't explain myself correctly, I need to have the DBO name and the login 'NT AUTHORITY\NETWORK SERVICE' I have read smoe post where they say this can't be done, but I already checked some DB that shows exactly that. Crazy


SO it is possible but how can you do that to show in the NAME column DBO and the Login of the DB 'NT AUTHORITY\NETWOK SERVICE'?

I tried the sp_changedbowner

Also sp_change_users_login

Thanks for the help

ALZDBA
ALZDBA
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12097 Visits: 8924
Emilio.Mendoza (9/10/2008)
Thanks for the reply I've already use those options, probably I didn't explain myself correctly, I need to have the DBO name and the login 'NT AUTHORITY\NETWORK SERVICE' I have read smoe post where they say this can't be done, but I already checked some DB that shows exactly that. Crazy

SO it is possible but how can you do that to show in the NAME column DBO and the Login of the DB 'NT AUTHORITY\NETWOK SERVICE'?


Thanks for the help


I don't think so.

What's the actual need to have specifically 'NT AUTHORITY\NETWOK SERVICE' ? (no one can log in as 'NT AUTHORITY\NETWOK SERVICE')

What would be the advantage ?

Why wouldn't 'sa' accomplish that ?

Johan


Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere w00t

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


press F1 for solution, press shift+F1 for urgent solution :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
Emilio.Mendoza
Emilio.Mendoza
SSC Rookie
SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)

Group: General Forum Members
Points: 48 Visits: 58
Well It is the client requirements since is for Sharepoint site or something like that and since they have it in that way in the other DB, is just the way they want it! Unsure I already set it up with another user they have for test since the purpose was to use this login to remove the old login which was for a person who already left the company, so for 'security' reasons they want to have that login in that user...
but I just want to know how they did in the other databases? Ermm
vgullotta
vgullotta
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 1
I am attempting to change a dbo login name and can't figure out how. Let me explain a little so you get what I am looking for.

This dbo login name is: ;test
I need to edit it to be: test

The reason for this is that I don't want to change the password on this login name, I just want to edit the username. It is basically because when we disable a user, our disable script or something like that changes it to ';username' from 'username'. Now I need to enable this login by simply renaming the login, but I don't know how to do it. Any suggestions?

Thanks in advance,

Vinny
Bite off more than you can chew. THEN CHEW IT!
K. Brian Kelley
K. Brian Kelley
Keeper of the Duck
Keeper of the Duck (10K reputation)

Group: Moderators
Points: 10224 Visits: 1917
vgullotta (3/10/2009)
I am attempting to change a dbo login name and can't figure out how. Let me explain a little so you get what I am looking for.

This dbo login name is: ;test
I need to edit it to be: test

The reason for this is that I don't want to change the password on this login name, I just want to edit the username. It is basically because when we disable a user, our disable script or something like that changes it to ';username' from 'username'. Now I need to enable this login by simply renaming the login, but I don't know how to do it. Any suggestions?

Thanks in advance,


If it's 2000, you'll need to delete and recreate. You can use sp_revlogin to dump the login with the encrypted password and SID and then modify the EXEC sp_addlogin to use the correct name.

How to transfer logins and passwords between instances of SQL Server

K. Brian Kelley
@‌kbriankelley
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search