Link to home
Start Free TrialLog in
Avatar of prairieits
prairieits

asked on

Painful Login Creation/Deletion Issues

We had a domain user have the audacity to go and get married.  Thus, she changed her last name.  Unfortunately, we didn't create a new account for her with her new name....rather, we changed her login name (thus using the same SID).  Well, now I need to add her to SQL security and I can't because her SID is listed and it shows her old name.  When I try to delete her SQL login, it says I can't because she is the owner of database objects.

1.  How do I display a list of objects and who owns them? (so I can change them to dbo)

or 2.  Can I just update her username in the sysxlogins table to reflect the new Active Directory account information?

Thanks,
Jerod
ASKER CERTIFIED SOLUTION
Avatar of AustinSeven
AustinSeven

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of prairieits
prairieits

ASKER

Austin,

That is great info.  Thanks for that.

One follow-up question is that the objects I am changing ownership on are all views.  When I run exec sp_changeobjectowner 'myViewName', 'dbo', I get an error saying: "Object 'myViewName' does not exist or is not a valid object for this operation."

Do I have to use a different sp to change ownership of a view or how do I change the ownership of the view?

Thanks,
Jerod
Avatar of Anthony Perkins
You need to qualify it with the existing object owner, as in:
exec sp_changeobjectowner 'existingowner.myViewName', 'dbo'