When connecting to SQL Server running on the same computer as the client, you can use (local) as the server name. This is not encouraged as it leads to ambiguity, however it can be useful when the client is known to be running on the intended computer. For instance, when creating an application for mobile disconnected users, such as a sales force, where SQL Server will run on laptop computers and store project data, a client connecting to (local) would always connect to the SQL Server running on the laptop. The word localhost or a period (.) can be used in place of (local).
By default, SQL Server connects to a local instance of SQL Server using the Shared Memory protocol, and to an instance of SQL Server on another computer using either TCP/IP or Named Pipes. Create an alias when you are using TCP/IP or named pipes, and you want to provide a customized connection string, or when you want to use a name other than the server name for the connection.
別名是 SQL Native Client 功能,有區分 32 bit 和 64 bit,SSMS V19.1 是 32bit,所以只要設定 SQL Native Client 11.0 組態 (32 位元) 就行,設定路徑為 SQL Server 組態管理員 (Configuration Manager) => SQL Native Client 11.0 組態 (32 位元) => 別名
Named Piples 或 TCPIP 都可以建立別名來連線本機,Shared Memory 則是無法
沒有留言:
張貼留言