473,412 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Changing table owner

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
3 81135
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" <ma*****@NOSPAMbartlett.net> wrote in message
news:bl**********@lust.ihug.co.nz...
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 #2
Manning (ma*****@NOSPAMbartlett.net) writes:
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?


Enterprise Manager is not much of a query tool. Use Query Analyzer
instead.
--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

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

Thanks for your advice - problem fixed.

Manning

"John Bell" <jb************@hotmail.com> wrote in message
news:3f**********************@reading.news.pipex.n et...
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

Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robbie | last post by:
Hi Guys Wonder if you could help me. Basically I produce an accounts package that uses a SQL 2000 DB as the RDBMS. I always instruct users to login as 'sa' and the relevant password when...
2
by: John | last post by:
Hi, I have a data driven application which has some generalized components. So, for reuse, I am building the components so they can be reused in other projects ... it takes almost no extra...
6
by: Jeff Kowalczyk | last post by:
I need to adapt this an update statement to a general form that will iterate over multiple orderids for a given customerinvoiceid. My first concern is a form that will work for a given orderid,...
16
by: StenKoll | last post by:
Help needed in order to create a register of stocks in a company. In accordance with local laws I need to give each individual share a number. I have accomplished this by establishing three tables...
3
by: CAD Fiend | last post by:
Hello, I have a land development project that has a many-to-many relationship. I have ONE question regarding table structures, and ONE question on how to make a Form with two Subforms, below. ...
7
by: Chris | last post by:
This should have been easy but I can't find the answer... I want to make every other row in my table a different row. I can't seem to find a way to do this through my Page_Load event like I...
0
by: Manning | last post by:
Hi - apologies for asking a stupid newbie question but I'm a bit out of my depth here and could really use some help. I've got an ASP module which can't find a table because the table owner is...
2
by: Francisco Reyes | last post by:
Is there a way to change a schema owner other than dump/restore? How about changing the nspowner in pg_namespace? Will that do the trick without any negative consecuences? ...
3
by: ArijitChaterjee | last post by:
I have a MS SQL Server Database which consists of several Tables, amongh some has owner as "dbo" and some has another owner like "xyz". Is there any T-SQL that can change the owner of the tables to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.