x

Alias definintion, what am I doing wrong?

Hi,

I tried to define an alias on a server (as part of a database consolidation), but it doesn't seem to work. These are the steps I did:

  1. started SQL configuration manager on the server
  2. created alias under "SQL Native Client 10.0 configuration (32bit)" with name NWGALIAS
  3. protocol TCP/IP, no port (Default)
  4. SQL browser service is running

Started SQLcmd.exe from a client as "sqlcmd -Snwgalias -E", but it's returning "could not open a connection to SQL server" Server is 64bit and so is client, so I created a 2nd alias (NWGALIAS2) under the "SQL Native Client 10.0 configuration" (I assume the is 64bit), but with no result.

What am I doing wrong?
more ▼

asked May 21, 2012 at 02:37 PM in Default

Wilfred van Dijk gravatar image

Wilfred van Dijk
1.3k 20 25 31

(comments are locked)
10|1200 characters needed characters left

4 answers: sort voted first
Create the alias on the client
more ▼

answered May 21, 2012 at 06:19 PM

KenJ gravatar image

KenJ
20.4k 1 4 12

The problem is that the application which is using the database is installed on several laptops (being used by field engineers). If creating an alias locally is the option, I could also alter the connection definition locally.

According to this link [link text][1] you could create an alias on the server also (first option)? It sounds stupid, but the article is not mentioning WHERE to define the alias.

[1]: http://www.mssqltips.com/sqlservertip/1620/how-to-setup-and-use-a-sql-server-alias/
May 22, 2012 at 07:53 AM Wilfred van Dijk

The client machine in the article has the Configuration Manager installed, which doesn't appear to match your environment. You mentioned that cliconfig works, but is not an option.

If you are not allowed to change anything on the client machine, you can create a DNS entry for NWGALIAS that points back to the "real" server.

If you are allowed to change something on the client, you can do the alias, change the application config file, or edit your hosts file with an entry for NWGALIAS that points to the "real" server to shortcut DNS.
May 22, 2012 at 02:50 PM KenJ
(comments are locked)
10|1200 characters needed characters left

Is TCP an enabled protocol for the instance?

Is the SQL Server Browser service running for the server?

.. .. ..
I have just created an alias on my local SQL 2008 instance via SQL Server Configuration Manager, SQL Native Client 11.0 Configuration (32bit), Aliases, New Alias... and everything seemed to work as normal.

Now, this is local, would there be a need for DNS to have an entry that points client PCs to my IP address so they can get picked up by SQL Browser service and passed(via the alias) to my instance?
more ▼

answered May 22, 2012 at 12:44 PM

Fatherjack gravatar image

Fatherjack ♦♦
42.8k 75 79 108

(comments are locked)
10|1200 characters needed characters left

As per the MSDN / SQL Server documentation on [Creating Server Aliases][1]:

... An alias is an alternate name that can be used to make a connection ... Aliases can be used by any client application ...

And the rest of that introductory paragraph makes it pretty clear that these are for client machines, rather than server-side setup, and this is confirmed by the structure on the left of the page, where it shows the following:

Database Engine Instances
  Client Network Configuration
    Configure Client Protocols
    Create or Delete a Server Alias for Use by a Client
    Logging In to SQL Server

etc, showing that this is part of the Client network configuration.

[1]: http://msdn.microsoft.com/en-us/library/ms190445.aspx
more ▼

answered May 22, 2012 at 08:32 AM

ThomasRushton gravatar image

ThomasRushton ♦
34.2k 18 20 44

(comments are locked)
10|1200 characters needed characters left

SQL Server Configuration Manager is not a tool which is installed on a client. So I assume you run this on a server.

Running cliconfg.exe on a client and creating an alias works, but that's not an option for me. This alias trick was mentioned as a temporary solution, until we manually changed the connection definition on each laptop to the 'real' servername.
more ▼

answered May 22, 2012 at 08:50 AM

Wilfred van Dijk gravatar image

Wilfred van Dijk
1.3k 20 25 31

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x127
x5

asked: May 21, 2012 at 02:37 PM

Seen: 1463 times

Last Updated: May 22, 2012 at 03:23 PM