Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

hosts file map alias to named instance ?

798 views
Skip to first unread message

John A Grandy

unread,
Apr 14, 2009, 7:26:31 PM4/14/09
to
Is it possible to use the Windows host file to map an alias to a named Sql
Server instance ?

So , the hosts file would read something like :

<sql server ip address>\<instance name> <alias>


Michael Sommer AT/NOSPAM

unread,
Apr 15, 2009, 5:36:23 AM4/15/09
to
John,

i dont think it is possible because the hosts file can only to ip adress to
hostname resolution.
The named instance is not a valid hostname...

you can use cliconfg to configure aliases for named instances!

Michael


"John A Grandy" <johnagrandy-at-gmail-dot-com> schrieb im Newsbeitrag
news:uPfbzhVv...@TK2MSFTNGP03.phx.gbl...

Ekrem Önsoy

unread,
Apr 15, 2009, 10:43:49 AM4/15/09
to
To create an Alias for SQL Server 2005\8

Go to: Start -> Programs -> Microsoft SQL Server 2005\8 -> Configuration
Tools -> SQL Server Configuration Manager.

Then from the SQL Server Configuration Manager MMC: SQL Native Client
Configuration -> Aliases

--
Ekrem Önsoy


"John A Grandy" <johnagrandy-at-gmail-dot-com>, iletisinde şunu yazdı,
news:uPfbzhVv...@TK2MSFTNGP03.phx.gbl...

SK

unread,
Jun 5, 2009, 4:21:01 PM6/5/09
to
I also need this functionality.
I created the alias. On the server machine it makes the registry entry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo with Key
Name:ServerAilasName, Data:DBMSSOCN,ServerName\InstanceName,Port#.
So from the SSMS on server machine I could connect to this instance.
Now When I tried to connect from my workstation(which is another computer) I
could not connect to this server/instance using the alias name.
So I edited my computers registry and added this key and values. Then I
could connect to this server and instance.
So my guess is on every client machine I'll have make this registry entry
manually or through some utility.
Question1: Is there any way I can connect to this server\namedInstance
without this registry entry? otherwise it defeats the whole purpose of having
alias.
Question2: When I created the linked server using this alias from my
computer, It comes with "Login timeout expired" and following error -
Named Pipes Provider: Could not open a connection to SQL Server [53].
(I did not enable Named Pipes protocol on the server for connection as I
want it to use TCP/IP). Is there any way I can force SSMS to use TCP/IP? Or
Am I missing anything here?
Any help is really appreciated.

Thanks,
SK

Linchi Shea

unread,
Jun 5, 2009, 5:02:01 PM6/5/09
to
> Question1: Is there any way I can connect to this server\namedInstance
> without this registry entry? otherwise it defeats the whole purpose of having
> alias.

You can always just use the server name followed by a comma and the port
number regardless what instance name may be. This doesn't need SQL Browser to
be online on the server side. So if your server name is ServerA and the
instance listens on port 6000, you can connect as:

osql -SServerA,6000 -E

> Question2: When I created the linked server using this alias from my
> computer, It comes with "Login timeout expired" and following error -
> Named Pipes Provider: Could not open a connection to SQL Server [53].
> (I did not enable Named Pipes protocol on the server for connection as I
> want it to use TCP/IP). Is there any way I can force SSMS to use TCP/IP? Or
> Am I missing anything here?

How did you create the linked server?

Linchi

SK

unread,
Jun 5, 2009, 5:18:01 PM6/5/09
to
Thanks Linchi for your quick reply.
I created sql server authentication login on target server.
Then through SSMS right click on Server Objects/Linked Server, New Linked
Server:
Linked Server: ServerAliasName
Server Type: SQL Server
Click on Security: Selected Radio button - Be made using this security
context:
Entered remote login:Login Name
with password: remote login password

Now my query:
Select * from [ServerAliasName].DBName.dbo.TableName
gives me error...

0 new messages