How can I execute SQL scripts using TeamCity?
In a command line build step:
c:\Program Files\Microsoft SQL Server\100\Tools\Binn\sqlcmd.exeCommand parameters:
-S <server> -i <path_to_file> <== Note: that's a capital
You may need to change the
100 to something else, depending on the version of the SQL Server tools that you have installed on the build agent.
I believe that SQLCMD / SQLPLUS / MYSQL are available as standalone executables which you can install on the TeamCity server.
However, without knowing your actual SQL Platform this may differ and the provider should have an alternative.
You can then create a Command Line Runner to call the executeable and pass in the parameters required, which are further explained here.
If you are looking at doing Database Migrations as part of your CI process, it would also be worth checking out RoundhousE