I have a build that I've setup using visual studio team services online. I want to execute a sql script on a remote server as a step, but don't see anything available out of box. The remote server has the agent installed on it. What's the best practice for doing this? Just put in a step that runs a powershell/bat file on the server and have that file execute the sql script?
SQL Server Data Tools for Visual Studio. Turn Visual Studio into a powerful development environment for SQL Server, Azure SQL Database and Azure SQL Data Warehouse.
You can add a step to run a PowerShell/batch script to execute the SQL script, and you can also create a custom build task and upload it to VSTS using TFX-CLI. For the custom task, refer to this link for details: http://shiningdragonsoftware.net/2015/08/13/tfs-build-2015-vnext-custom-tasks/
Nowadays there is a Build Task available in the VSTS marketplace. As far as I can tell it's the powershell solution as mentioned in another answer, but then nicely wrapped up in a package.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With