mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-17 02:51:45 -05:00
Fixing a notebook history bug in SQL Agent (#1199)
* Added a leading 0 to notebook history runtimes * Fixing comment * Fix for getting run date and time for notebook jobs in a proper format - Try2 * Reverting back to previous query
This commit is contained in:
@@ -1551,8 +1551,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
|
|||||||
DataTable materializedNotebookTable = await AgentNotebookHelper.GetAgentNotebookHistories(connInfo, jobId, targetDatabase);
|
DataTable materializedNotebookTable = await AgentNotebookHelper.GetAgentNotebookHistories(connInfo, jobId, targetDatabase);
|
||||||
foreach (DataRow materializedNotebookRow in materializedNotebookTable.Rows)
|
foreach (DataRow materializedNotebookRow in materializedNotebookTable.Rows)
|
||||||
{
|
{
|
||||||
string materializedRunDateTime = materializedNotebookRow["run_date"].ToString() + materializedNotebookRow["run_time"].ToString();
|
notebookHistoriesDict.Add(materializedNotebookRow["job_runtime"].ToString(), materializedNotebookRow);
|
||||||
notebookHistoriesDict.Add(materializedRunDateTime, materializedNotebookRow);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// adding notebook information to job histories
|
// adding notebook information to job histories
|
||||||
|
|||||||
@@ -258,12 +258,11 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
|
|||||||
@"
|
@"
|
||||||
SELECT
|
SELECT
|
||||||
materialized_id,
|
materialized_id,
|
||||||
run_time,
|
|
||||||
run_date,
|
|
||||||
notebook_error,
|
notebook_error,
|
||||||
pin,
|
pin,
|
||||||
notebook_name,
|
notebook_name,
|
||||||
is_deleted
|
is_deleted,
|
||||||
|
FORMAT(msdb.dbo.agent_datetime(run_date, run_time), 'yyyyMMddHHmmss') as job_runtime
|
||||||
FROM
|
FROM
|
||||||
notebooks.nb_materialized
|
notebooks.nb_materialized
|
||||||
WHERE job_id = @jobId";
|
WHERE job_id = @jobId";
|
||||||
|
|||||||
Reference in New Issue
Block a user