In SQL Server Management Studio, it is possible to run batch commands when in SQLCMD mode, using the !! command. However, in Azure Data Studio, this does not seem to work (SQLCMD has been available in ADS since version 1.13.0 in November 2019), I'm running ADS as Windows Administrator.

How can I execute batch commands in Azure Data Studio using SQLCMD mode? Did I miss something, or is there some of the (scarce) documentation I need to read?

- In SQL Server Management Studio:

Works in SQL Server Management Studio

- In Azure Data Studio

Doesn't work in ADS

1 Answer 1


This is a known open issue with SQLCMD in ADS, where SQLCMD mode fails to parse some sqlcmd keywords. The issue is currently on the backlog.

ADS includes a terminal window (View-->Terminal) so you can easily run OS commands on your client under the same query tab without SQLCMD.

  • Excellent, thank you! I wanted some batch commands to be included in the script to get the current folder for :R include files. At least now I can check up on the backlog progress/status. Commented Mar 3, 2021 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.