Renaming Sql Server

Cloned a sql database server for testing.  Renamed the physical server name to dev.  The SQL Server still has the name of the live server, how do I rename it to Dev?  Microsoft Server 2008 R2 with SQL Server 2008 R2
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Aneesh RetnakaranDatabase AdministratorCommented:
1. Rename the physical server and reboot
2. From ssms execute below to drop the current server name
EXEC sp_DROPSERVER 'oldservername'
2. Execute below to add a new server name. Make sure local is specified.
EXEC sp_ADDSERVER 'newservername', 'local'
3. Restart SQL Services.
4. Verify the new name using:
SELECT * FROM sys.servers WHERE server_id = 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
PDISAuthor Commented:
When I run, EXEC sp_DROPSERVER 'oldservername'  I get the following message

(1 row(s) affected)
Msg 15190, Level 16, State 1, Procedure sp_dropserver, Line 56
There are still remote logins or linked logins for the server 'oldservername'
Aneesh RetnakaranDatabase AdministratorCommented:
try this statement, it works in SQL 2014 not sure it works in SQL 2008

exec sp_dropserver 'oldservername', @droplogins = 'droplogins'
PDISAuthor Commented:
When I ran that command, it came back with an error, Cannot drop server 'oldservername' because it is used a Publisher in replication.  

On the test server I went into Replications - Local Publications and deleted all entries there but I still receive the same error.  Please advise if I should open this a new question.
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

From novice to tech pro — start learning today.