Confused with server name

  • Hi I am trying to set up a replicated server. I am just trying to set up a test for my own benefit.

    I have registered my local sql server it appears in the enterprise manager with its name but when I run @@servername it has a different name!!! Why is this I am very confused but I think it will be the course of my attempt to set up a distributor, when I do I get this message.

    DQL Server Enterprise Manager could not configure a534 as the distributor for a534

    error 18482: could not connect to server 'a534 because a500 is not defined as a remote server

    please help me

  • The times I have seen that happen it was because the server used to have 1 name when SQL was installed and the server name was later changed.

    Try this

    EXEC sp_dropserver

    GO

    EXEC sp_addserver , 'LOCAL'

    GO

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • Have you tried running this statement?

    SELECT @@servername,serverproperty ('servername')

    If the values are not equal you can use the script below

    got this from http://support.microsoft.com/kb/818334

    -- Use the Master database

    USE master

    GO

    -- Declare local variables

    DECLARE @serverproperty_servername varchar(100),

    @servername varchar(100)

    -- Get the value returned by the SERVERPROPERTY system function

    SELECT @serverproperty_servername = CONVERT(varchar(100), SERVERPROPERTY('ServerName'))

    -- Get the value returned by @@SERVERNAME global variable

    SELECT @servername = CONVERT(varchar(100), @@SERVERNAME)

    -- Drop the server with incorrect name

    EXEC sp_dropserver @server=@servername

    -- Add the correct server as a local server

    EXEC sp_addserver @server=@serverproperty_servername, @local='local'

    After running the script it is best to restart the server

    NOTE: If the name of your server in your sql server group is 'LOCAL' replication may fail so i think you must do the following:

    1. Right click the server you want to replicate

    2. Choose "Delete SQL Server Registration"

    3. Right click on the SQL Server Group

    4. Choose "New SQL Server Registration"

    5. Add the server again but by its computer name

    "-=Still Learning=-"

    Lester Policarpio

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply