SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Enable SQLCMD Mode in SQL Server Management Studio

SQLCMD mode in SSMS allows you to use the command line tool within SSMS. Using this feature of the SSMS, you don’t have to connect SQLCMD using the command prompt. It is really very helpful and less distracting when you want to connect with multiple SQL Server instances. You can follow the below steps to enable at session level.

  • Go menu option “Query”
  • Click on the SQLCMD mode

Demonstration 

  • Now open a Query windows type “:connect” syntax to multiple instance;

:connect SQL2K16N1 ---Key here your server name 
select @@servername as servername
go
:connect SQL2K16N2 ---Key here your server name 
select @@servername as servername
go
:connect SQL2K16N3 ---Key here your server name 
select @@servername as servername
go

  • Let’s try to ping your server from SSMS

  • Now, let’s check the directly details from SSMS

Hope, you find useful the basic learning of SQL Server!

The post Enable SQLCMD Mode in SQL Server Management Studio appeared first on .

SQL Geek

Dharmendra is a SQL Server/Microsoft Data Platform professional with over eight years of experience. He enjoys helping others in the SQL Server community and does this by contributing on blogs, speaking at several SQL events. His passion and focus is to explore and share more and more on SQL Server.

Comments

Leave a comment on the original post [www.dharmendrakeshari.com, opens in a new window]

Loading comments...