sqlcmd is a cross-platform command-line database utility developed by Microsoft for interacting with SQL Server and Azure SQL environments. Written in Go, it uses the go-mssqldb driver rather than the traditional ODBC implementation. Users can execute Transact-SQL queries interactively, process SQL script files, or accept piped input for automation. Integrated commands create and manage local SQL Server instances through compatible container runtimes. Persistent connection contexts simplify switching between database servers and authentication configurations. Microsoft Entra ID integration supports interactive authentication, managed identities, and service principals. Configurable output formats include traditional horizontal results, vertical layouts, and ASCII tables. sqlcmd supports Windows, macOS, and Linux.

Features

  • Cross-platform SQL Server and Azure SQL database connectivity through the native Go database driver
  • Interactive Transact-SQL execution with batch processing, script file support, and piped command input
  • Automated local SQL Server instance provisioning through Docker and Podman container runtimes
  • Persistent database connection contexts with configurable YAML files and generated connection strings
  • Microsoft Entra ID authentication supporting interactive sessions, managed identities, and service principals
  • Customizable query result formatting with ASCII tables, vertical layouts, console coloring, and driver diagnostic logging

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow sqlcmd

sqlcmd Web Site

Other Useful Business Software
One Monitoring Tool for IT, OT and Cloud | Free Trial Icon
One Monitoring Tool for IT, OT and Cloud | Free Trial

Vendor-agnostic monitoring across on-prem servers, cloud platforms and OT devices, all in one dashboard. No more tool sprawl.

Modern infrastructure spans data centers, cloud platforms and factory floors, and every blind spot between them is a risk. PRTG supports SNMP, WMI, SSH and other standard protocols to monitor IT, OT and hybrid environments through one customizable dashboard. Build the views your team needs, from network health to application performance, without switching tools. Try PRTG free for 30 days now.
Try PRTG Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of sqlcmd!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Go

Related Categories

Go Command Line Tools, Go SQL Clients

Registered

8 hours ago