364,111 Members | 2068 Browsing Online
Community for Developers & IT Professionals
Bytes IT Community

Changing table owner

Manning
P: n/a
Manning
Hi- apologies for asking a stupid newbie question, but I'm really stuck at
the moment. I need to change table ownership.

I've got an asp script which is looking for a table owned by the dbo role,
however the table was created under a different ownership. I understand the
problem, and almost understand the solution, but I can't seem to get all the
way.

THE PROBLEM (using [server].[database].[owner].[table])
[mgbsvr1].[dnn].[dnnadmin].[aspsearch]
needs to be
[mgbsvr1].[dnn].[dbo].[aspsearch]

I looked up the books online and found this syntax:
sp_changeobjectowner [ @objname = ] 'object' , [ @newowner = ] 'owner'

But I can't see how to use it, nor more importantly, where I should use it.
It won't work in the query tool in Enterprise Manager. If I need to create a
script (which I've never done before), how do I execute the script?

All help deeply appreciated
Manning, Sydney


Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


John Bell
P: n/a
John Bell
Hi

You will need to be connected to [mgbsvr1].[dnn] with either sysadmin,
db_ddladmin and db_securityadmin rights or the dbo to issue the statement

sp_changeobjectowner '[dnnadmin].[aspsearch]' , 'dbo'

John

"Manning" <manning@NOSPAMbartlett.net> wrote in message
news:blcb0l$vk1$1@lust.ihug.co.nz...[color=blue]
> Hi- apologies for asking a stupid newbie question, but I'm really stuck at
> the moment. I need to change table ownership.
>
> I've got an asp script which is looking for a table owned by the dbo role,
> however the table was created under a different ownership. I understand[/color]
the[color=blue]
> problem, and almost understand the solution, but I can't seem to get all[/color]
the[color=blue]
> way.
>
> THE PROBLEM (using [server].[database].[owner].[table])
> [mgbsvr1].[dnn].[dnnadmin].[aspsearch]
> needs to be
> [mgbsvr1].[dnn].[dbo].[aspsearch]
>
> I looked up the books online and found this syntax:
> sp_changeobjectowner [ @objname = ] 'object' , [ @newowner = ] 'owner'
>
> But I can't see how to use it, nor more importantly, where I should use[/color]
it.[color=blue]
> It won't work in the query tool in Enterprise Manager. If I need to create[/color]
a[color=blue]
> script (which I've never done before), how do I execute the script?
>
> All help deeply appreciated
> Manning, Sydney
>
>[/color]


Jul 20 '05 #2

Erland Sommarskog
P: n/a
Erland Sommarskog
Manning (manning@NOSPAMbartlett.net) writes:[color=blue]
> But I can't see how to use it, nor more importantly, where I should use
> it. It won't work in the query tool in Enterprise Manager. If I need to
> create a script (which I've never done before), how do I execute the
> script?[/color]

Enterprise Manager is not much of a query tool. Use Query Analyzer
instead.


--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #3

Manning
P: n/a
Manning
John and Erland

Thanks for your advice - problem fixed.

Manning

"John Bell" <jbellnewsposts@hotmail.com> wrote in message
news:3f79bb7b$0$8769$ed9e5944@reading.news.pipex.n et...[color=blue]
> Hi
>
> You will need to be connected to [mgbsvr1].[dnn] with either sysadmin,
> db_ddladmin and db_securityadmin rights or the dbo to issue the statement
>
> sp_changeobjectowner '[dnnadmin].[aspsearch]' , 'dbo'
>
> John[/color]


Jul 20 '05 #4

Post your reply

Help answer this question



Didn't find the answer to your Microsoft SQL Server question?

You can also browse similar questions: Microsoft SQL Server