且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SQL Server 2017 EXPRESS 安装 SQLCMD 设置远程连接

更新时间:2022-06-10 22:52:56

1.配置管理器内启动TCP/IP协议(端口改为1433)以及加入防火墙允许

2.进入本地实例:

cmd 

Microsoft Windows [版本 6.3.9600]
(c) 2013 Microsoft Corporation。保留所有权利。

C:\Users\Administrator>sqlcmd -S .\SQLEXPRESS
1> select @@version
2> GO




--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
------------------------------------------------------------
Microsoft SQL Server 2017 (RTM) - 14.0.1000.169 (X64)
        Aug 22 2017 17:04:49
        Copyright (C) 2017 Microsoft Corporation
        Express Edition (64-bit) on Windows Server 2012 R2 Datacenter 6.3 <X64>
(Build 9600: ) (Hypervisor)


(1 行受影响)
1>

2.使用DAC允许远程连接

1> sp_configure 'remote admin connections',1
2> GO
配置选项 'remote admin connections' 已从 0 更改为 1。请运行 RECONFIGURE 语句进行
安装。
1> RECONFIGURE;
2> select @@version
3> GO