Had a need to run a dacpac script that wasn’t part of pre or post deployments. You can use sqlcmd to do that for you by issuing the following:-

Sqlcmd –S <server>\<instance> -v <variablename>=<variablevalue> -i <sql script to run>.sql


Sqlcmd –S localhost\myinstance -v databasename=mydatabase -i myscript.sql

Categories: Comps

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: