Advertisement

02.26.2008 at 08:08AM PST, ID: 23193946
[x]
Attachment Details

change table schema - SQL Server 2005

Asked by corcon in SQL Server 2005, Windows 2003 Server

Tags: Microsoft, SQL Server, 2005

Hello,

I had a server crash on my old SQL2000 server.  I was recover the database files and I attached them in a new SQL 2005 server.  But I got only one problem.  Most tables were created by me and have dbo. as schema name.  A few tables where created by a user that din't have dbo rights.  So it has another schema.  

Now by migrating it I got orphaned users, so I can't use ALTER SCHEMA.  I tried to change the object owner with sp_changeobjectowner. I get Object 'XXX' does not exist or is not a valid object for this operation. Is it enough to change the user with sp_change_users_login.  The solution is in that direction I think, but I'm certainly not an SQL Expert, so I hope to find some help over here...

So my main question; How can I change the schema of a few tables XXX.tablename to dbo.tablename so they become usable in my web application again?

Thanks in advance.

K.Start Free Trial
 
Loading Advertisement...
 
[+][-]02.26.2008 at 08:44AM PST, ID: 20986017

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 09:09AM PST, ID: 20986288

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 09:11AM PST, ID: 20986314

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 09:14AM PST, ID: 20986347

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 09:17AM PST, ID: 20986374

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Server 2005, Windows 2003 Server
Tags: Microsoft, SQL Server, 2005
Sign Up Now!
Solution Provided By: chapmandew
Participating Experts: 1
Solution Grade: B
 
 
[+][-]02.26.2008 at 09:24AM PST, ID: 20986454

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 09:26AM PST, ID: 20986482

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628