<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic RE: How to fetch the data's from SQL Server agent jobs? in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/How-to-fetch-the-data-s-from-SQL-Server-agent-jobs/m-p/94103#M43512</link>
    <description>&lt;SPAN&gt;Hi Jamuna,&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Paste below from my response to your question from another thread you have created:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please remove GO from the statement. It is not needed for a single statement procedure.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tested this in my environment and you will likely encounter an issue where Blue Prism complains about "Can't convert System.Guid to a Blue Prism data type.". In this case, I would advise you to use the SELECT query behind the stored procedure dbo.sp_help_jobactivity to do what you need. The trick is to convert the UNIQUEIDENTIFIER column job_id to CHAR(36). The query may look like below, note the highlighted sections:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SELECT ja.session_id,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;CONVERT(CHAR(36),ja.job_id) AS job_id&lt;/SPAN&gt;&lt;SPAN&gt;,j.name AS job_name,ja.run_requested_date,ja.run_requested_source,ja.queued_date,ja.start_execution_date,ja.last_executed_step_id,ja.last_executed_step_date,ja.stop_execution_date,ja.next_scheduled_run_date,ja.job_history_id,jh.message,jh.run_status,jh.operator_id_emailed,jh.operator_id_netsent,jh.operator_id_paged FROM(msdb.dbo.sysjobactivity ja LEFT JOIN msdb.dbo.sysjobhistory jh ON ja.job_history_id=jh.instance_id) join msdb.dbo.sysjobs_view j on ja.job_id=j.job_id WHERE j.name='&lt;/SPAN&gt;&lt;SPAN&gt;job name&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note you will need to execute the query using an account with sufficient permission to msdb database.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my testing, I am able to obtain a collection like below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="24638.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/24772i422B0C4453C7746D/image-size/large?v=v2&amp;amp;px=999" role="button" title="24638.png" alt="24638.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Bruce Liu&lt;BR /&gt;Senior Product Consultant, Professional Services&lt;BR /&gt;Blue Prism&lt;BR /&gt;Australia/Sydney&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Fri, 07 May 2021 00:57:00 GMT</pubDate>
    <dc:creator>bruce.liu</dc:creator>
    <dc:date>2021-05-07T00:57:00Z</dc:date>
    <item>
      <title>How to fetch the data's from SQL Server agent jobs?</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-fetch-the-data-s-from-SQL-Server-agent-jobs/m-p/94101#M43510</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I need to fetch the data's from SQL server agent jobs, For that I have used data SQL server set connection action that's fine &amp;amp;&amp;nbsp; then used data SQL server set collection action, In this action I need to give the SQL input to fetch the data's from SQL server agent jobs, I don't know how to give the query in this SQL input field.&lt;BR /&gt;Can anyone guide me please&amp;nbsp;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Jamuna T&lt;BR /&gt;RPA developer&lt;BR /&gt;Changepond Technology&lt;BR /&gt;chennai&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 05 May 2021 15:19:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-fetch-the-data-s-from-SQL-Server-agent-jobs/m-p/94101#M43510</guid>
      <dc:creator>JamunaT</dc:creator>
      <dc:date>2021-05-05T15:19:00Z</dc:date>
    </item>
    <item>
      <title>RE: How to fetch the data's from SQL Server agent jobs?</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-fetch-the-data-s-from-SQL-Server-agent-jobs/m-p/94102#M43511</link>
      <description>Please see my response on your other &lt;A href="https://community.blueprism.com/communities/community-home/digestviewer/viewthread?GroupId=511&amp;amp;MessageKey=6ec28a4d-5fa4-4f4b-8834-8433f6edcc4d&amp;amp;CommunityKey=318951ad-ae66-4c81-9cf3-5df9bbc9c455&amp;amp;tab=digestviewer&amp;amp;ReturnUrl=%2fcommunity-discussions%2fallrecentposts&amp;amp;SuccessMsg=Thank%20you%20for%20submitting%20your%20message.#bm6ec28a4d-5fa4-4f4b-8834-8433f6edcc4d" target="_blank" rel="noopener"&gt;thread&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Ben Lyons&lt;BR /&gt;Product Consultant&lt;BR /&gt;Blue Prism&lt;BR /&gt;UK&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 06 May 2021 09:39:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-fetch-the-data-s-from-SQL-Server-agent-jobs/m-p/94102#M43511</guid>
      <dc:creator>Ben.Lyons1</dc:creator>
      <dc:date>2021-05-06T09:39:00Z</dc:date>
    </item>
    <item>
      <title>RE: How to fetch the data's from SQL Server agent jobs?</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-fetch-the-data-s-from-SQL-Server-agent-jobs/m-p/94103#M43512</link>
      <description>&lt;SPAN&gt;Hi Jamuna,&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Paste below from my response to your question from another thread you have created:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please remove GO from the statement. It is not needed for a single statement procedure.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tested this in my environment and you will likely encounter an issue where Blue Prism complains about "Can't convert System.Guid to a Blue Prism data type.". In this case, I would advise you to use the SELECT query behind the stored procedure dbo.sp_help_jobactivity to do what you need. The trick is to convert the UNIQUEIDENTIFIER column job_id to CHAR(36). The query may look like below, note the highlighted sections:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SELECT ja.session_id,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;CONVERT(CHAR(36),ja.job_id) AS job_id&lt;/SPAN&gt;&lt;SPAN&gt;,j.name AS job_name,ja.run_requested_date,ja.run_requested_source,ja.queued_date,ja.start_execution_date,ja.last_executed_step_id,ja.last_executed_step_date,ja.stop_execution_date,ja.next_scheduled_run_date,ja.job_history_id,jh.message,jh.run_status,jh.operator_id_emailed,jh.operator_id_netsent,jh.operator_id_paged FROM(msdb.dbo.sysjobactivity ja LEFT JOIN msdb.dbo.sysjobhistory jh ON ja.job_history_id=jh.instance_id) join msdb.dbo.sysjobs_view j on ja.job_id=j.job_id WHERE j.name='&lt;/SPAN&gt;&lt;SPAN&gt;job name&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note you will need to execute the query using an account with sufficient permission to msdb database.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my testing, I am able to obtain a collection like below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="24638.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/24772i422B0C4453C7746D/image-size/large?v=v2&amp;amp;px=999" role="button" title="24638.png" alt="24638.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Bruce Liu&lt;BR /&gt;Senior Product Consultant, Professional Services&lt;BR /&gt;Blue Prism&lt;BR /&gt;Australia/Sydney&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 07 May 2021 00:57:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-fetch-the-data-s-from-SQL-Server-agent-jobs/m-p/94103#M43512</guid>
      <dc:creator>bruce.liu</dc:creator>
      <dc:date>2021-05-07T00:57:00Z</dc:date>
    </item>
  </channel>
</rss>

