Change owner of a view

I have lots of VIEWs that I have created in my DB. It turns out that one VIEW took my NT user as the owner of the VIEW. normally its dbo. i need the owner to be dbo so I can make changes to it because at the moment it gives me an error saying that the object name (the views name) is invalid.
thanks
cm
LVL 1
carlosmonteAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

muzzy2003Commented:
EXEC sp_changeobjectowner 'view name', 'dbo'
0
carlosmonteAuthor Commented:
Where do I run this command, I only use eterprise manager and am kinda new on db
0
muzzy2003Commented:
You need to run it in SQL Query Analyser. It's in the Tools menu in EM. Log on, then select the appropriate database from the dropdown at the top of the window. Paste this code into the window, and hit F5 to run it.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

carlosmonteAuthor Commented:
great, thanks
0
carlosmonteAuthor Commented:
Could you tell me how it came to get to be owned by my user when normally its owner is just dbo when i've create others?
0
muzzy2003Commented:
It's owned by whoever you're authenticated as when you create it. If that user is a member of the dbo role, then I think it should be assigned to dbo as owner. If not, for whatever reason, it will be assigned to the NT or SQL login that you are using. Since you do this via EM, I am slightly perplexed, as you are likely always to authenticate in the same way. Could someone else have been playing with the database at the same time, or do you have exclusive use of it. They could have been tinkering with role memberships.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.