Visual studio team services online – running a sql script

Question:

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?

Answer:

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/

Source:

Visual studio team services online – running a sql script by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply