I'm running using the MSBuild build runner in TeamCity 9 as part of my build process.
In some of the MSBuild files, I'm running nested SQL via the MSBuild.ExtensionPack.SqlServer namespace. If an error occurs when running the SQL code, the MSBuild target does not return an error to the TeamCity build, so the overall build status is successful with no errors logged.
How exactly do I get an error to return from SQL to MSBuild in order to fail the TeamCity build that's running it?
Here is sample code with an intentional mistake in the SQL code, this code will not return an error to the build when run:
<Target Name="RunSQL">
<MSBuild.ExtensionPack.SqlServer.SqlCmd
TaskAction="Execute"
CommandLineQuery="EXEC [Database1].dbo].[UpdateSomething]" />
</Target>