Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

PK Index owned by different user - how can I fix

Posted on 2006-10-31
4
Medium Priority
?
1,311 Views
Last Modified: 2012-08-13

I have an SQL 2000 database which is "managed" by a third party application.  When we use the application to delete users, it automatically changes the ownership of any tables the deleted user owned to another user.  I can only assume they use sp_changeowner through the backend - i haven't tried running a trace to confirm.

Somewhere along the lines I have two users that now own only the primary key on several tables.  The tables themselves are owned by another user.  Constraints are setup by the 3rd party app which prevent me from deleting and recreating the index, and I don't want to delete the whole table.  

Can anyone suggest a way to change the ownership on the primary key index?  I didn't realize it was even possible to have tables and indexes owned by different people for the same table.

Thanks.
0
Comment
Question by:ehaley
[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
4 Comments
 
LVL 9

Accepted Solution

by:
gpompe earned 1000 total points
ID: 17845777
Have you tried with sp_changeobjectowner ?
0
 
LVL 9

Expert Comment

by:gpompe
ID: 17845801
You can use sp_helpconstraint  to get the name of the PK
0
 
LVL 11

Expert Comment

by:rw3admin
ID: 17846017
honestly this is the first time I am hearing that a table is created by one user and PK is under another user...

query sysreferences and sysindexes tables and you will see what I mean...

rw3admin
0
 
LVL 1

Author Comment

by:ehaley
ID: 17858073

gpompe - my original message was a typo, I was using sp_changeobjectowner.  I finally figured the problem out myself.  It appears there was some error when sp_changeobjectowner was run the first time and it did not change the ownership of the primary key index, only the table, so they ended up being owned by different people.  It was not allowing me to change the ownership of either object to either object since each login already owned "part" of the object.  I ended up transferring ownership of the table to a third login, which correctly changed the table and the PK, then I changed it back.  

Thanks for your help.
Jeff
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
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 extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how the fundamental information of how to create a table.

670 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