Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object without owner?!?!

Status
Not open for further replies.
Apr 24, 2003
5
US
Hello people,

anyone has this problem? I'm seeing an object without owner in my database. So I cannot delete it or alter it. Anyone knows
- how can reproduce this situation ?
- how can it happen?
- how can I detour it?

I don't know... :-(

Thanks a lot
Cris
 
not sure about reporoduce. ive seen it happen quit a few ways, but memory fuzzy right now.

you should be able to run sp_changeobjectowner. look it up in bol. but you plug in objectname, newowner. It should allow you to change it even with a null owner.
 
As Corran007 said, it will work if the owner is 'NULL'. I had this issue myself.

Run this (change 'mydatabase' to whatever the name is of your database).

use mydatabase
go
exec sp_helpuser 'dbo'
go

That will show you who dbo is assigned to.

Then run this to change the owner to SA:

use mydatabase
go
exec sp_changedbowner 'sa'
go

Thanks to Corran007, MaffewW, and osjohnm for giving me this solution when I needed it.

-SQLBill
 
Thanks to Corran007 and SQLBill,

the object in this case is a view, and I have different results:

- When I run the procedure sp_changeobjectowner, I receive the message:
sp_changeobjectowner 'VIEW1', 'dbo'
go
Server: Msg 15001, Level 16, State 1, Procedure sp_changeobjectowner,
Line 38
Object 'view1' does not exist or is not a valid object for this operation.

- select name,xtype,uid from sysobjects where name like 'view1'
view1 V 21

- SELECT * FROM INFORMATION_SCHEMA.VIEWS
where table_name = 'view1'

mydata NULL gsis_utilizacao
create view view1 as select nome,sum (consultas) as quantidade from consutasDia NONE NO

:-(


 
This looks as if you may have restored the database from a backup taken on a
different machine or attached them from a different server?

In which case you probably have orphaned users. If you have not transferred
the user you will need to and then resolve the orphans





Thanks

J. Kusch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top