How to run a SQL query using command prompt without SQL SSMS

175 views 21:18 0 Comments 31 October 2019

Introduction

How to run a SQL query using command prompt without SQL SSMS
Open CMD from Run and run the below command (CMD) to connect with Database engine.

sqlcmd -S WIN-81L2H4SUHDH\MSSQLSERVER,14331

**WIN-81L2H4SUHDH\MSSQLSERVER  --> This should be FQDN**

Then you can run type your SQL query. Once you are done with all your statement then put an enter. Then type Go and put enter. Shown in the below screen shot.

SQLCMD
SQLCMD

Leave a Reply

Your email address will not be published. Required fields are marked *