T-SQL筆記25_找出SQL Server instance name_增加其他別名的instance
在 MSSQL中
假若想要得知當前連接的資料庫 instance名稱
可以下如下指令
1 2 3 4 5 | SELECT @@servername AS 'Server Name' -- The database server's machine name ,@@servicename AS 'Instance Name' -- e.g.: MSSQLSERVER ,DB_NAME() AS 'Database Name' ,HOST_NAME() AS 'Host Name' -- The database client's machine name |
而預設在連線實體上也可以看到instance名稱
也可以透過
SQL Server Configuration Manager
在windows按鍵旁輸入框
輸入SQLServerManager15.msc
(這邊我用的是SSMS18)
來查找開啟看後綴
補充
SQL Server 2005 版本
=> SQLServerManager.msc
SQL Server 2008 版本
=>SQLServerManager10.msc
SQL Server 2012 版本
=>SQLServerManager11.msc
SQL Server 2014 版本
=>SQLServerManager12.msc
SQL Server 2016 版本
=>SQLServerManager13.msc
SQL Server 2017 版本(SSMS17)
=> SQLServerManager14.msc
SQL Server 2019 版本(SSMS18)
=>SQLServerManager15.msc
假若我今天想新增一個別名
HostName\SQLEXPRESS
17-0535860-01\SQLEXPRESS
則要透過Installer來做額外安裝
然後接受合約並按下一步直到出現接下畫面
如此就能夠在本機同時有兩個instance了
Ref:
SQL Server 組態管理員
如何把 SQL Server 標準版當成 SQL Server Express 來用
SQL2008 - 安裝多 Instances 執行個體在同一台 Server
How do I find the MS SQL instance name on my Windows system?
[MSSQL] 快速開啟 SSMS & SQL Server Configuration Manager
How to get current instance name from T-SQL
SQL Server - How to Create Multiple Instances on Single Server
Create a new SQL Server Instance
Create Microsoft SQL Server named instances
Steps to Connect to SQL Server When all System Administrators are Locked Out
SQL Server Single User Mode Connection with SQL Server Management Studio
Login failed for user ‘xxx’. Reason: Server is in single user mode. Only one administrator can connect at this time.
Help: How to fix error – Reason: Server is in single user mode. Only one administrator can connect at this time
留言
張貼留言