﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Administering / SQL Server 2005  / Change @@servername in SQL 2005 / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 18 May 2013 14:23:04 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Change @@servername in SQL 2005</title><link>http://www.sqlservercentral.com/Forums/Topic660346-146-1.aspx</link><description>yup... realized that... see my previous post...</description><pubDate>Thu, 19 Feb 2009 08:48:19 GMT</pubDate><dc:creator>Richard M.</dc:creator></item><item><title>RE: Change @@servername in SQL 2005</title><link>http://www.sqlservercentral.com/Forums/Topic660346-146-1.aspx</link><description>[quote][b]Richard M (2/19/2009)[/b][hr]um....sp_dropserver will "remove a server from the list of known remote and linked servers on the local instance of SQL Server"..... so it will not affect at all your running instance. when you run sp_helpserver you are getting production right?Not sure if only the sp_addserver with the 'local' option will do the trick[/quote]You can change the Servername using sp_addserver.Refer [url]http://msdn.microsoft.com/en-us/library/ms143799.aspx?ppud=4 [/url]</description><pubDate>Thu, 19 Feb 2009 08:46:53 GMT</pubDate><dc:creator>ps.</dc:creator></item><item><title>RE: Change @@servername in SQL 2005</title><link>http://www.sqlservercentral.com/Forums/Topic660346-146-1.aspx</link><description>Well, found this [url=http://blogs.techrepublic.com.com/datacenter/?p=192]http://blogs.techrepublic.com.com/datacenter/?p=192[/url]So apparently the trick with sp_dropserver/addserver and restarting the SQL services does accomplish what you need?</description><pubDate>Thu, 19 Feb 2009 08:44:43 GMT</pubDate><dc:creator>Richard M.</dc:creator></item><item><title>RE: Change @@servername in SQL 2005</title><link>http://www.sqlservercentral.com/Forums/Topic660346-146-1.aspx</link><description>I dont think you need to restore system databases to make a copy of production. Because Dev and Prod are completely different instances.Dev and prod need to match with their schema and not system databases.To avoid any other problems please revert back your dev system databases from backup. Like if you are updating something on Dev box with the criteria of @@servername then it would update your production(only if this job uses an account that exists on prod, but it is a possibility)Thanks!!</description><pubDate>Thu, 19 Feb 2009 08:39:15 GMT</pubDate><dc:creator>The_SQL_DBA</dc:creator></item><item><title>RE: Change @@servername in SQL 2005</title><link>http://www.sqlservercentral.com/Forums/Topic660346-146-1.aspx</link><description>um....sp_dropserver will "remove a server from the list of known remote and linked servers on the local instance of SQL Server"..... so it will not affect at all your running instance. when you run sp_helpserver you are getting production right?Not sure if only the sp_addserver with the 'local' option will do the trick</description><pubDate>Thu, 19 Feb 2009 08:32:59 GMT</pubDate><dc:creator>Richard M.</dc:creator></item><item><title>RE: Change @@servername in SQL 2005</title><link>http://www.sqlservercentral.com/Forums/Topic660346-146-1.aspx</link><description>Yes.</description><pubDate>Thu, 19 Feb 2009 08:30:28 GMT</pubDate><dc:creator>Erin.</dc:creator></item><item><title>RE: Change @@servername in SQL 2005</title><link>http://www.sqlservercentral.com/Forums/Topic660346-146-1.aspx</link><description>Did you say you restored the dev server system  databases with the backup from production system databases?Thanks!!</description><pubDate>Thu, 19 Feb 2009 08:26:53 GMT</pubDate><dc:creator>The_SQL_DBA</dc:creator></item><item><title>RE: Change @@servername in SQL 2005</title><link>http://www.sqlservercentral.com/Forums/Topic660346-146-1.aspx</link><description>I also noticed the following logins:PRODUCTION\SQLServer2005MSFTEUser$PRODUCTION$MSSQLSERVERPRODUCTION\SQLServer2005MSSQLUser$PRODUCTION$MSSQLSERVERPRODUCTION\SQLServer2005SQLAgentUser$PRODUCTION$MSSQLSERVERThey should be:DEVELOPMENT\SQLServer2005MSFTEUser$DEVELOPMENT$MSSQLSERVERDEVELOPMENT\SQLServer2005MSSQLUser$DEVELOPMENT$MSSQLSERVERDEVELOPMENT\SQLServer2005SQLAgentUser$DEVELOPMENT$MSSQLSERVERWould below script fix these as well?exec sp_dropserver PRODUCTIONGOexec sp_addserver DEVELOPMENT, 'local'GO</description><pubDate>Thu, 19 Feb 2009 08:13:55 GMT</pubDate><dc:creator>Erin.</dc:creator></item><item><title>RE: Change @@servername in SQL 2005</title><link>http://www.sqlservercentral.com/Forums/Topic660346-146-1.aspx</link><description>You would need to do this then, won't affect anything else unless you have any jobs that use the old server name. If so you need to updated them with the new server name.   1. sp_dropserver 'old_name'     2. go     3. sp_addserver 'new_name','local'     4. go  Also restart sql server asnet stop mssqlservernet start mssqlserverThis should do the trick for youThanks!!</description><pubDate>Thu, 19 Feb 2009 08:09:02 GMT</pubDate><dc:creator>The_SQL_DBA</dc:creator></item><item><title>RE: Change @@servername in SQL 2005</title><link>http://www.sqlservercentral.com/Forums/Topic660346-146-1.aspx</link><description>The OS recognizes the development server name correctly.  It seems like everything recognizes it correctly except @@servername.</description><pubDate>Thu, 19 Feb 2009 08:03:19 GMT</pubDate><dc:creator>Erin.</dc:creator></item><item><title>RE: Change @@servername in SQL 2005</title><link>http://www.sqlservercentral.com/Forums/Topic660346-146-1.aspx</link><description>You can do so by changing the name of your server from windows OS. Then restart SQL server. Your new name should reflect when you run select @@servername again.Thanks!!</description><pubDate>Thu, 19 Feb 2009 08:00:43 GMT</pubDate><dc:creator>The_SQL_DBA</dc:creator></item><item><title>Change @@servername in SQL 2005</title><link>http://www.sqlservercentral.com/Forums/Topic660346-146-1.aspx</link><description>I setup a development server by restoring the system databases from the production server.  However, I am now running into a problem with a trigger that is pulling the server name from @@servername.  When I select @@servername it returns the production server's name.  How can I change @@servername to reflect the development server's name?  Both servers are local sql installs.  There are no other instances.  When I remote into the development server using Management Studio I use what the development server name should be.  This name is just not reflected in @@servername.Can I use the sp_dropserver, sp_addserver?  Would doing this have any adverse affects on the databases, jobs, etc?sp_dropserver  GOsp_addserver  , localGOI really don't want to rebuild this development sql server.  That would probably involve contacting the vendor, which would means more money.</description><pubDate>Thu, 19 Feb 2009 07:55:47 GMT</pubDate><dc:creator>Erin.</dc:creator></item></channel></rss>