grunt-sqlcmd

build and execute sqlcmd

Usage no npm install needed!

<script type="module">
  import gruntSqlcmd from 'https://cdn.skypack.dev/grunt-sqlcmd';
</script>

README

grunt-sqlcmd Build Status NPM version Dependencies

Execute sqlcmd from the command line.

Provides the task sqlcmd, which builds

grunt.initConfig({
  'sqlcmd': {
    options: {
      sqlcmd: '.\\path\\to\\sqlcmd.exe' // defaults to 'sqlcmd.exe'
    },
    'my-db': {
      src: [ 'path\\to\\files\\*.sql' ], // location of sql scripts to run
      options: {
        server: 'my.server',
        database: 'my_database',
        username: 'user',
        password: 'password'
      }
    }
  }
});

Usage:

grunt sqlcmd:my-db

Future plans:

Integrate with a pure nodejs version of sqlcmd (maybe)