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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Ownership on Views in SQL2000 1

Status
Not open for further replies.

nes105

Technical User
Jan 15, 2004
14
US
I found today that somehow the ownership on 122 views in one of my databases had changed. I can't figure out how the ownership changed, but I discovered the problem when running a Crystal report, which gets data from this particular database. The "set location" in the report clearly identifies the owner as "dbo". In looking at the views in Enterprise Manager I notice that "dbo" is no longer the owner. Is there a means by which I might change the ownership on the views? I don't seem to find anything helpful in Enterprise Manager. I am not familiar with writing SQL programming statements.

Thanks
 
You can use the sp_changeowner procedure to change each view's owner.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005) / MCITP Database Administrator (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Thanks... I see the command, and it's syntax, in the help file, but I can't figure out where to type it... can I do this through Enterprise Manager, or do I need to run the command somewhere else?

Thanks again
 
You need to run it in Query Analyzer.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005) / MCITP Database Administrator (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
That did the trick... thanks for the help! [thumbsup2]
 
no problem.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005) / MCITP Database Administrator (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top