简体   繁体   中英

Connecting to remote SQL Server instance alias

I've created alias for my instance, like it is said here How do we alias a Sql Server instance name used in a Connection String .config? or here http://technet.microsoft.com/en-us/library/ms190445.aspx .

I can connect to it locally using InstanceAliasName .

But I can't connect locally to this alias using MachineName\\InstanceAlias . I receive an error:

"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)"

How can I connect to ServerName\\InstanceAlias ?

You should create Alias just for instance, It means you can connect only by InstanceAliasName, You can not combine again MachineName and AliasName.

If you create alias with MachineName\\InstanceAliasName you can connect by MachineName\\InstanceAliasName.

For example: Machine Name: DBSERVER Instance Name: SQL2008R2

You can create alias name same as: DBSERVER\\SQLS

Now you can connect to instance by DBSERVER\\SQLS .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM