@script-box/mssql-tool.cli

A simple tool for Microsoft Sql Server

Usage no npm install needed!

<script type="module">
  import scriptBoxMssqlToolCli from 'https://cdn.skypack.dev/@script-box/mssql-tool.cli';
</script>

README

@script-box/mssql-tool.cli

A simple tool for Microsoft Sql Server

Install

npm install @script-box/mssql-tool.cli --save-dev

Usage

Under the hood, mssql-tool uses mssql with the default tedious driver. For commands that connect to a database, the arguments map to the options in these packages.

create-database

npx mssql create-database MyDatabase --server MY_SERVER_NAME --username admin --password p@$w0rd

Run npx mssql help create-database for more options.

create-login

npx mssql create-login new_user_name new_password --server MY_SERVER_NAME --database MyDatabase --username windows_user --password p@$w0rd

Run npx mssql help create-login for more options.

create-migration

npx mssql create-migration

Run npx mssql help create-migration for more options.

run-migrations

npx mssql run-migrations /path/to/migrations --server MY_SERVER_NAME --database MyDatabase --username windows_user --password p@$w0rd

Run npx mssql help run-migrations for more options.

drop-database

npx mssql drop-database MyDatabase --server MY_SERVER_NAME --username admin --password p@$w0rd

Run npx mssql help drop-database for more options.