SQL Command Line Utility

Export and import CSV, execute SQL queries and scripts
against any database in the same way

SQL Server, Oracle, DB2, NuoDB, SQL CE, MySQL, PostgreSQL, SQLite

5 steps to like gsqlcmd


Create and use named connections

You may keep safe database connection strings in configuration files and use them by names.

To create or edit a local configuration file, run the following command

  1. gsqlcmd localconfig

gsqlcmd starts a visual editor where you may manage connection strings.


Execute SQL scripts

Execute SQL script files against any database in the same way using named connections.

  1. gsqlcmd execute mssql-master create-logins.sql
  2. gsqlcmd execute mssql-demo application-install.sql /trace
  3. gsqlcmd execute mssql-demo payments.insert.sql

Export data to CSV and plain text

Export CSV data from any database in an easy way using CSV specific options.

  1. gsqlcmd execute sqlce-payments payments.sql payments.csv /separator=, /outputCodepage=65001

Export data to plain text using scripts or inline queries.

  1. gsqlcmd execute sqlce-payments "SELECT * FROM Payments" payments.txt

Create HTML documents using templates

Insert HTML output from databases into HTML templates and documents using placeholders.

  1. gsqlcmd execute mysql payments.sql payments.htm /template=template.htm /placeholder={payments}
  2. gsqlcmd execute mysql top5.sql     payments.htm /append /placeholder={top5}
  3. gsqlcmd execute mysql bottom5.sql  payments.htm /append /placeholder={bottom5}

Create DDL and DML statements from CSV

Create format files, DDL and DML statements based on CSV data.

  1. gsqlcmd fmt    mssql-demo payments.csv payments.fmt
  2. gsqlcmd create mssql-demo payments.csv create-table.sql /table=dbo.Payments
  3. gsqlcmd insert mssql-demo payments.csv insert.sql /table=dbo.Payments
  4. gsqlcmd update mssql-demo payments.csv update.sql /table=dbo.Payments
  5. gsqlcmd delete mssql-demo payments.csv delete.sql /table=dbo.Payments
  6. gsqlcmd merge  mssql-demo payments.csv merge.sql  /table=dbo.Payments

You are ready!

Just try! You will like it.


Named connections
Executing SQL script files
Exporting to CSV, text, and HTML
Generating DDL statements
Generating DML statements50 rows
Perpetual license, per copyFree$24$39
Subscription, 1 year, per copy$12$19
Commercial usex

Supported database platforms: SQL Server, SQL Server Compact, Oracle, DB2, NuoDB, MySQL, PostgreSQL, SQLite

Want more tools?

Try and use a universal HTML, XML, JSON and plain text parser, gwebcmd, for free.

This website is using cookies. By continuing to browse, you give us your consent to our use of cookies as explained in our Cookie Policy.