Showing posts with label environment. Show all posts
Showing posts with label environment. Show all posts

Monday, March 26, 2012

Rename Server

I am using SQL Server 2005 in a test environment and I want to rename the server to match my production environment. Currently the name is the same as my computer name. Can it be changed? Do I have to change my computer name? (My computer is not on the same network so it is possible).Renaming the server ... I would go there. It's probably easier to backup all databases, uninstall the SQL server, reinstall it and restore the backups. If it only is for remote connections, you can also create a DNS alias for the machine it's running on. Your network admin can help you with that.
Renaming the machine has also some nice caveats, we went there and we ended up reinstalling the whole machine ... again, don't go there !

Gr,
Yveau|||you can get around having to reinstall after renaming a machine by using sp_dropserver and sp_addserver and then restarting the sql services.

however I think this guy does not want the sql server instance to have the same name as a machine for whatever reason. it kind of annoys me anytime I get a request to rename anything (a machine, a database, table, column etc...) in sql server. it s always about someone's personal preference or some new naming convention that will expire with his\her employment and there is always some peice of code or a connection string that not get updated somewhere which causes some problem.|||it s always about someone's personal preference ...

Even better, some user's preference. And looking at my signature, you might guess how I feel about that. :p
I totaly agree with you, renaming is completely useless. After all the interfacing is not done in the database. If you want something nice on the screen, write a decent GUI. Don't start renaming the database ...

Gr,
Yveausql

Wednesday, March 21, 2012

Rename a linked server

I have an app that has some stored procedures running queries across a linked server. In our development environment, the linked database is on a box called 10.xxx.xxx.xx. In the production environment, the linked database will be on a server called something else. What I want to do is have the linked server in the development environment named the same thing as the linked server in the production environment, so that I won't have to change the stored procedures when migrating the project into production.

SQL Server 2005 isn't giving me the option to rename or alias the linked server, though. Is there anyway to do this so that I can have the linked server named the same thing on the two different boxes and not have to change the sp's?

I don't think you can rename linked servers, but you can create them correctly for your needs. Don't select SQL Server, but do select the SQL native client, or just use T-SQL which may make more sense if trying to standardise stuff accross machines anyway

EXEC sp_addlinkedserver @.server= 'FRED1' ,@.provider='SQLNCLI' ,@.datasrc='10.1.1.1' ,@.srvproduct = 'SQL'

In future please try and pick a more appropriate forum. This is really SQL Server question issue, not SSIS.

sql