?
Solved

Change Database Ownership from a restored database

Posted on 2013-11-01
4
Medium Priority
?
259 Views
Last Modified: 2014-09-24
I have a MS SQL 2000 server that I took the backup databases from, and restored them to a new and differently named MS SQL 2008 R2 server.

The restore went fine, and I can browse the tables and run queries.

I am installing an ERP Database Server Software (Infor Syteline 8.03) in a linked multi-site environment.
When I got to link the databases, I get the following error.

"Failed to link the database as multi-site:
[Microsoft][ODBC SQL Server Driver][SQL Server] Could not find server 'OLD SERVER NAME' in sys.servers. Verify thath the correct server name was specified. If necessary, execute the stored procedure SP_addlinkedserver to add the server to sys.servers.
[Microsoft][ODBC SQL Server Driver][SQL Server] The statement has been terminated."

I guess I am looking for a Query to change "OLD SERVER NAME" to "NEW SERVER NAME"

The stored procedure sp_addserver 'NEW SERVER NAME', 'local'; will not work because it says the server already exists.

I did not migrate the master database to this server. could that be the issue.
0
Comment
Question by:Moordoom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 40

Expert Comment

by:lcohan
ID: 39617183
This will change it to SA but you can replace that with the owner you want:

exec sp_changedbowner 'sa'
ALTER AUTHORIZATION ON SCHEMA::OneShopSecureCart TO dbo;
GO
0
 
LVL 40

Expert Comment

by:lcohan
ID: 39617191
For linked server I think you are out of luck with rename because I don't think you can rename linked servers, but you can create them correctly for your needs.

Before dropping existing linked server MAKE SURE you right click and script it the save that and keep safe!!
0
 

Author Comment

by:Moordoom
ID: 39617867
EXEC sp_changedbowner 'sa' does not change the server the driver is trying to look for.
I am looking for a way to change the server name in sys.servers
0
 
LVL 40

Accepted Solution

by:
lcohan earned 2000 total points
ID: 39617884
Your question title is:

<<Change Database Ownership from a restored database>>

and sp_changedbowner does exactly that.


In the details you ask indeed for a linked server name change and my comment Posted on 2013-11-01 at 11:33:37  ID: 39617191 is just the answer to that. You can't rename it, you can't update SQL System tables directly anymore.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Know what services you can and cannot, should and should not combine on your server.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question