mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 10:58:30 -05:00
Added more options to job changes and elaborated error messages (#775)
* job step type and error message details change * added newline for both environments * checked for inner exceptions * sorted imports
This commit is contained in:
@@ -9,6 +9,7 @@ using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Microsoft.SqlServer.Management.Common;
|
||||
using Microsoft.SqlServer.Management.Sdk.Sfc;
|
||||
using Microsoft.SqlServer.Management.Smo;
|
||||
using Microsoft.SqlServer.Management.Smo.Agent;
|
||||
using Microsoft.SqlTools.ServiceLayer.Agent.Contracts;
|
||||
|
||||
@@ -33,8 +34,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
|
||||
public const string UrnRetriesAttempted = "RetriesAttempted";
|
||||
public const string UrnServer = "Server";
|
||||
internal const string UrnServerTime = "CurrentDate";
|
||||
|
||||
public static AgentJobInfo ConvertToAgentJobInfo(JobProperties job)
|
||||
|
||||
public static AgentJobInfo ConvertToAgentJobInfo(JobProperties job)
|
||||
{
|
||||
return new AgentJobInfo
|
||||
{
|
||||
@@ -217,5 +218,20 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
|
||||
}
|
||||
return jobs;
|
||||
}
|
||||
|
||||
public static AgentSubSystem ConvertToAgentSubSytem(string subSystem)
|
||||
{
|
||||
switch(subSystem)
|
||||
{
|
||||
case ("Transact-SQL script (T-SQL"):
|
||||
return AgentSubSystem.TransactSql;
|
||||
case ("Operating system (CmdExec)"):
|
||||
return AgentSubSystem.CmdExec;
|
||||
case ("PowerShell"):
|
||||
return AgentSubSystem.PowerShell;
|
||||
default:
|
||||
return AgentSubSystem.TransactSql;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user