I’m kind of lost. My jenkins pipeline is calling a stored procedure via powershell and Invoke-Sqlcmd.
When my stored precdure runs on error, the pipeline succeeds.
Groovy loos like this.
stage('Call procedure') {
steps {
script{
try{
powershell("""
Invoke-Sqlcmd -ServerInstance "server123" -Database "yxz" -AbortOnError -QueryTimeout 0 -Query "EXECUTE usp_procedure"
""")
} catch (Exception e) {
catchError("Error", buildResult: 'FAILURE')
}
}
}
}
Any help is preciated.
Best Regards