diff --git a/src/Microsoft.SqlTools.ServiceLayer/Agent/AgentService.cs b/src/Microsoft.SqlTools.ServiceLayer/Agent/AgentService.cs index 6f824146..1e247add 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Agent/AgentService.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Agent/AgentService.cs @@ -1551,8 +1551,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent DataTable materializedNotebookTable = await AgentNotebookHelper.GetAgentNotebookHistories(connInfo, jobId, targetDatabase); foreach (DataRow materializedNotebookRow in materializedNotebookTable.Rows) { - string materializedRunDateTime = materializedNotebookRow["run_date"].ToString() + materializedNotebookRow["run_time"].ToString(); - notebookHistoriesDict.Add(materializedRunDateTime, materializedNotebookRow); + notebookHistoriesDict.Add(materializedNotebookRow["job_runtime"].ToString(), materializedNotebookRow); } // adding notebook information to job histories diff --git a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/AgentNotebookHelper.cs b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/AgentNotebookHelper.cs index 398995cb..8717652e 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/AgentNotebookHelper.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/AgentNotebookHelper.cs @@ -258,12 +258,11 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent @" SELECT materialized_id, - run_time, - run_date, notebook_error, pin, notebook_name, - is_deleted + is_deleted, + FORMAT(msdb.dbo.agent_datetime(run_date, run_time), 'yyyyMMddHHmmss') as job_runtime FROM notebooks.nb_materialized WHERE job_id = @jobId";