Saturday, July 29, 2017

What is mssql-scripter?

In your SSMS on your computer you can use the Generate Scripts drop-down
menu to create scripts for database objects as shown here for Northwind database on SQL Server 2016 SP1.

However, the above is for SQL Server on Windows Platform. However, mssql-scripter tool provide the same functionality as Generate Scripts wizard on SQL Servers on Linux and macOS. Of course mssql-scripter would work on Windows as well.

Using mssql-scripter based on Python you can generate T-SQL scripts for objects on SQL Servers, Azure SQL database and Azure SQL Data Warehouse.

The generated script is saved to a .sql file or, on Linux can be piped to standard Unix utilities (sed, awk and grep ). The scripts can be checked into source control systems as well.

The source code for mssq-scripter is found here:
https://github.com/Microsoft/sql-xplat-cli

No comments: