<?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: SQL query to fetch results for process logging extensively in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84612#M35725</link>
    <description>Hi Saif,&lt;BR /&gt;&lt;BR /&gt;Please find the below query and also just to note you will get 0.00 values for logs having very less bytes in contrast to other higher values:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-sql"&gt;&lt;CODE&gt;SELECT processname,CONVERT(DECIMAL(7,2),Sum(
IsNull(DataLength(sessionnumber), 1)
+ IsNull(DataLength(stageid), 1)
+ IsNull(DataLength(stagename), 1)
+ IsNull(DataLength(stagetype), 1)
+ IsNull(DataLength(processname), 1)
+ IsNull(DataLength(pagename), 1)
+ IsNull(DataLength(objectname), 1)
+ IsNull(DataLength(actionname), 1)
+ IsNull(DataLength(result), 1)
+ IsNull(DataLength(resulttype), 1)
+ IsNull(DataLength(startdatetime), 1)
+ IsNull(DataLength(enddatetime), 1)
+ IsNull(DataLength(attributexml), 1)
+ IsNull(DataLength(automateworkingset), 1)
+ IsNull(DataLength(targetappname), 1)
+ IsNull(DataLength(targetappworkingset), 1)
)/1073741824) AS session_log_size
From
BPASessionLog_NonUnicode
GROUP BY
processname
ORDER BY session_log_size DESC​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;Also if it resolves your query,&lt;SPAN&gt;&amp;nbsp;then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;----------------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Devneet Mohanty&lt;BR /&gt;Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,&lt;BR /&gt;WonderBotz India Pvt. Ltd.&lt;BR /&gt;Blue Prism Community MVP | Blue Prism 7x Certified Professional&lt;BR /&gt;Website: &lt;A href="https://devneet.github.io/" target="test_blank"&gt;https://devneet.github.io/&lt;/A&gt;&lt;BR /&gt;Email: devneetmohanty07@gmail.com&lt;BR /&gt;&lt;BR /&gt;----------------------------------&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Mon, 06 Jun 2022 08:35:00 GMT</pubDate>
    <dc:creator>devneetmohanty07</dc:creator>
    <dc:date>2022-06-06T08:35:00Z</dc:date>
    <item>
      <title>SQL query to fetch results for process logging extensively</title>
      <link>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84606#M35719</link>
      <description>Can someone please help with a SQL query to check which process is logging excessively in database?</description>
      <pubDate>Sat, 04 Jun 2022 03:39:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84606#M35719</guid>
      <dc:creator>Saif</dc:creator>
      <dc:date>2022-06-04T03:39:00Z</dc:date>
    </item>
    <item>
      <title>RE: SQL query to fetch results for process logging extensively</title>
      <link>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84607#M35720</link>
      <description>Hi Saiful Khan,&lt;BR /&gt;&lt;BR /&gt;You can refer to the below query for your requirement:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-sql"&gt;&lt;CODE&gt;SELECT A.processname,COUNT(A.logid) AS log_entries
FROM [Blue Prism].[dbo].[BPASessionLog_NonUnicode] A INNER JOIN [Blue Prism].[dbo].[BPAProcess] B 
ON A.processname = B.name
GROUP BY A.processname​
ORDER BY COUNT(A.logid) DESC&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19018.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19170i685ABB88CB2A37DC/image-size/large?v=v2&amp;amp;px=999" role="button" title="19018.png" alt="19018.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;This query will give you the count of the log entries available for each process in descending order&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;----------------------------------&lt;BR /&gt;Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Devneet Mohanty&lt;BR /&gt;Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,&lt;BR /&gt;WonderBotz India Pvt. Ltd.&lt;BR /&gt;Blue Prism Community MVP | Blue Prism 7x Certified Professional&lt;BR /&gt;Website: &lt;A href="https://devneet.github.io/" target="test_blank"&gt;https://devneet.github.io/&lt;/A&gt;&lt;BR /&gt;Email: devneetmohanty07@gmail.com&lt;BR /&gt;&lt;BR /&gt;----------------------------------&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Sat, 04 Jun 2022 07:07:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84607#M35720</guid>
      <dc:creator>devneetmohanty07</dc:creator>
      <dc:date>2022-06-04T07:07:00Z</dc:date>
    </item>
    <item>
      <title>RE: SQL query to fetch results for process logging extensively</title>
      <link>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84608#M35721</link>
      <description>Hi Devneet,&lt;BR /&gt;&lt;BR /&gt;Thanks for the query, is there way that we could fetch the size of the logs per process in gb/mb&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Original Message:&lt;BR /&gt;Sent: 06-04-2022 08:06&lt;BR /&gt;From: Devneet Mohanty&lt;BR /&gt;Subject: SQL query to fetch results for process logging extensively&lt;BR /&gt;&lt;BR /&gt;Hi ,&lt;BR /&gt;&lt;BR /&gt;You can refer to the below query for your requirement:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-sql"&gt;&lt;CODE&gt;SELECT A.processname,COUNT(A.logid) AS log_entriesFROM [Blue Prism].[dbo].[BPASessionLog_NonUnicode] A INNER JOIN [Blue Prism].[dbo].[BPAProcess] B ON A.processname = B.nameGROUP BY A.processname​ORDER BY COUNT(A.logid) DESC&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19020.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19172iBF7824F2F43E9DCC/image-size/large?v=v2&amp;amp;px=999" role="button" title="19020.png" alt="19020.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;This query will give you the count of the log entries available for each process in descending order&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;----------------------------------&lt;BR /&gt;Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Devneet Mohanty&lt;BR /&gt;Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,&lt;BR /&gt;WonderBotz India Pvt. Ltd.&lt;BR /&gt;Blue Prism Community MVP | Blue Prism 7x Certified Professional&lt;BR /&gt;Website: &lt;A href="https://devneet.github.io/"&gt;https://devneet.github.io/&lt;/A&gt;&lt;BR /&gt;Email: &lt;A href="mailto:devneetmohanty07@gmail.com"&gt;devneetmohanty07@gmail.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;----------------------------------&lt;BR /&gt;</description>
      <pubDate>Sat, 04 Jun 2022 07:15:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84608#M35721</guid>
      <dc:creator>Saif</dc:creator>
      <dc:date>2022-06-04T07:15:00Z</dc:date>
    </item>
    <item>
      <title>RE: SQL query to fetch results for process logging extensively</title>
      <link>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84609#M35722</link>
      <description>Hi Saif,&lt;BR /&gt;&lt;BR /&gt;Please find the below updated query:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-sql"&gt;&lt;CODE&gt;SELECT processname,
Sum(
IsNull(DataLength(sessionnumber), 1)
+ IsNull(DataLength(stageid), 1)
+ IsNull(DataLength(stagename), 1)
+ IsNull(DataLength(stagetype), 1)
+ IsNull(DataLength(processname), 1)
+ IsNull(DataLength(pagename), 1)
+ IsNull(DataLength(objectname), 1)
+ IsNull(DataLength(actionname), 1)
+ IsNull(DataLength(result), 1)
+ IsNull(DataLength(resulttype), 1)
+ IsNull(DataLength(startdatetime), 1)
+ IsNull(DataLength(enddatetime), 1)
+ IsNull(DataLength(attributexml), 1)
+ IsNull(DataLength(automateworkingset), 1)
+ IsNull(DataLength(targetappname), 1)
+ IsNull(DataLength(targetappworkingset), 1)
) session_log_size
From
BPASessionLog_NonUnicode
GROUP BY
processname
ORDER BY session_log_size DESC​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19021.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19174i569D7ECD49EB2A46/image-size/large?v=v2&amp;amp;px=999" role="button" title="19021.png" alt="19021.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Hope this helps you out.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;----------------------------------&lt;BR /&gt;Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Devneet Mohanty&lt;BR /&gt;Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,&lt;BR /&gt;WonderBotz India Pvt. Ltd.&lt;BR /&gt;Blue Prism Community MVP | Blue Prism 7x Certified Professional&lt;BR /&gt;Website: &lt;A href="https://devneet.github.io/" target="test_blank"&gt;https://devneet.github.io/&lt;/A&gt;&lt;BR /&gt;Email: devneetmohanty07@gmail.com&lt;BR /&gt;&lt;BR /&gt;----------------------------------&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Sat, 04 Jun 2022 07:51:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84609#M35722</guid>
      <dc:creator>devneetmohanty07</dc:creator>
      <dc:date>2022-06-04T07:51:00Z</dc:date>
    </item>
    <item>
      <title>RE: SQL query to fetch results for process logging extensively</title>
      <link>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84610#M35723</link>
      <description>Thanks alot Devneet&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Original Message:&lt;BR /&gt;Sent: 06-04-2022 08:51&lt;BR /&gt;From: Devneet Mohanty&lt;BR /&gt;Subject: SQL query to fetch results for process logging extensively&lt;BR /&gt;&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Please find the below updated query:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-sql"&gt;&lt;CODE&gt;SELECT processname,Sum(IsNull(DataLength(sessionnumber), 1)+ IsNull(DataLength(stageid), 1)+ IsNull(DataLength(stagename), 1)+ IsNull(DataLength(stagetype), 1)+ IsNull(DataLength(processname), 1)+ IsNull(DataLength(pagename), 1)+ IsNull(DataLength(objectname), 1)+ IsNull(DataLength(actionname), 1)+ IsNull(DataLength(result), 1)+ IsNull(DataLength(resulttype), 1)+ IsNull(DataLength(startdatetime), 1)+ IsNull(DataLength(enddatetime), 1)+ IsNull(DataLength(attributexml), 1)+ IsNull(DataLength(automateworkingset), 1)+ IsNull(DataLength(targetappname), 1)+ IsNull(DataLength(targetappworkingset), 1)) session_log_sizeFromBPASessionLog_NonUnicodeGROUP BYprocessnameORDER BY session_log_size DESC​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19024.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19179i5DEBAB2DA97D777C/image-size/large?v=v2&amp;amp;px=999" role="button" title="19024.png" alt="19024.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Hope this helps you out.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;----------------------------------&lt;BR /&gt;Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Devneet Mohanty&lt;BR /&gt;Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,&lt;BR /&gt;WonderBotz India Pvt. Ltd.&lt;BR /&gt;Blue Prism Community MVP | Blue Prism 7x Certified Professional&lt;BR /&gt;Website: &lt;A href="https://devneet.github.io/"&gt;https://devneet.github.io/&lt;/A&gt;&lt;BR /&gt;Email: &lt;A href="mailto:devneetmohanty07@gmail.com"&gt;devneetmohanty07@gmail.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;----------------------------------&lt;BR /&gt;</description>
      <pubDate>Sat, 04 Jun 2022 08:05:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84610#M35723</guid>
      <dc:creator>Saif</dc:creator>
      <dc:date>2022-06-04T08:05:00Z</dc:date>
    </item>
    <item>
      <title>RE: SQL query to fetch results for process logging extensively</title>
      <link>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84611#M35724</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Can you please enhance the query to be in gb&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 06 Jun 2022 08:12:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84611#M35724</guid>
      <dc:creator>Saif</dc:creator>
      <dc:date>2022-06-06T08:12:00Z</dc:date>
    </item>
    <item>
      <title>RE: SQL query to fetch results for process logging extensively</title>
      <link>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84612#M35725</link>
      <description>Hi Saif,&lt;BR /&gt;&lt;BR /&gt;Please find the below query and also just to note you will get 0.00 values for logs having very less bytes in contrast to other higher values:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-sql"&gt;&lt;CODE&gt;SELECT processname,CONVERT(DECIMAL(7,2),Sum(
IsNull(DataLength(sessionnumber), 1)
+ IsNull(DataLength(stageid), 1)
+ IsNull(DataLength(stagename), 1)
+ IsNull(DataLength(stagetype), 1)
+ IsNull(DataLength(processname), 1)
+ IsNull(DataLength(pagename), 1)
+ IsNull(DataLength(objectname), 1)
+ IsNull(DataLength(actionname), 1)
+ IsNull(DataLength(result), 1)
+ IsNull(DataLength(resulttype), 1)
+ IsNull(DataLength(startdatetime), 1)
+ IsNull(DataLength(enddatetime), 1)
+ IsNull(DataLength(attributexml), 1)
+ IsNull(DataLength(automateworkingset), 1)
+ IsNull(DataLength(targetappname), 1)
+ IsNull(DataLength(targetappworkingset), 1)
)/1073741824) AS session_log_size
From
BPASessionLog_NonUnicode
GROUP BY
processname
ORDER BY session_log_size DESC​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;Also if it resolves your query,&lt;SPAN&gt;&amp;nbsp;then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;----------------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Devneet Mohanty&lt;BR /&gt;Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,&lt;BR /&gt;WonderBotz India Pvt. Ltd.&lt;BR /&gt;Blue Prism Community MVP | Blue Prism 7x Certified Professional&lt;BR /&gt;Website: &lt;A href="https://devneet.github.io/" target="test_blank"&gt;https://devneet.github.io/&lt;/A&gt;&lt;BR /&gt;Email: devneetmohanty07@gmail.com&lt;BR /&gt;&lt;BR /&gt;----------------------------------&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 06 Jun 2022 08:35:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84612#M35725</guid>
      <dc:creator>devneetmohanty07</dc:creator>
      <dc:date>2022-06-06T08:35:00Z</dc:date>
    </item>
    <item>
      <title>RE: SQL query to fetch results for process logging extensively</title>
      <link>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84613#M35726</link>
      <description>&lt;STRONG&gt;this gives 0.00 in the output for every column&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 06 Jun 2022 08:49:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84613#M35726</guid>
      <dc:creator>Saif</dc:creator>
      <dc:date>2022-06-06T08:49:00Z</dc:date>
    </item>
    <item>
      <title>RE: SQL query to fetch results for process logging extensively</title>
      <link>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84614#M35727</link>
      <description>Hi Saif,&lt;BR /&gt;&lt;BR /&gt;Like I said depends on the precision on the values you have with you. If you increase the precision to 38 which is maximum for a decimal you will get the proper value but you need to do it for all the columns:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-plsql"&gt;&lt;CODE&gt;SELECT processname,CONVERT(DECIMAL(38,2),Sum(
CONVERT(DECIMAL(38,2), IsNull(DataLength(sessionnumber), 1))
+ CONVERT(DECIMAL(38,2), IsNull(DataLength(stageid), 1))
+ CONVERT(DECIMAL(38,2), IsNull(DataLength(stagename), 1))
+ CONVERT(DECIMAL(38,2), IsNull(DataLength(stagetype), 1))
+ CONVERT(DECIMAL(38,2), IsNull(DataLength(processname), 1))
+ CONVERT(DECIMAL(38,2), IsNull(DataLength(pagename), 1))
+ CONVERT(DECIMAL(38,2), IsNull(DataLength(objectname), 1))
+ CONVERT(DECIMAL(38,2), IsNull(DataLength(actionname), 1))
+ CONVERT(DECIMAL(38,2), IsNull(DataLength(result), 1))
+ CONVERT(DECIMAL(38,2), IsNull(DataLength(resulttype), 1))
+ CONVERT(DECIMAL(38,2), IsNull(DataLength(startdatetime), 1))
+ CONVERT(DECIMAL(38,2), IsNull(DataLength(enddatetime), 1))
+ CONVERT(DECIMAL(38,2), IsNull(DataLength(attributexml), 1))
+ CONVERT(DECIMAL(38,2), IsNull(DataLength(automateworkingset), 1))
+ CONVERT(DECIMAL(38,2), IsNull(DataLength(targetappname), 1))
+ CONVERT(DECIMAL(38,2), IsNull(DataLength(targetappworkingset), 1))
)/1073741824) AS session_log_size
From
BPASessionLog_NonUnicode
GROUP BY
processname
ORDER BY session_log_size DESC​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19029.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19182i2505ECCB8BDD83E7/image-size/large?v=v2&amp;amp;px=999" role="button" title="19029.png" alt="19029.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;NOTE: If you have very small values even 2 decimal precision will show you 0.00 and won't suffice in that case try with some parameter like&lt;CODE&gt; (38,12)&lt;/CODE&gt;. You need to experiment here and see what fits your use case according to your data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE class="language-plsql"&gt;&lt;CODE&gt;SELECT processname,CONVERT(DECIMAL(38,12),Sum(
CONVERT(DECIMAL(38,12), IsNull(DataLength(sessionnumber), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(stageid), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(stagename), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(stagetype), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(processname), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(pagename), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(objectname), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(actionname), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(result), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(resulttype), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(startdatetime), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(enddatetime), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(attributexml), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(automateworkingset), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(targetappname), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(targetappworkingset), 1))
)/1073741824) AS session_log_size
From
BPASessionLog_NonUnicode
GROUP BY
processname
ORDER BY session_log_size DESC​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19030.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19181i63572059D6A204F3/image-size/large?v=v2&amp;amp;px=999" role="button" title="19030.png" alt="19030.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;----------------------------------&lt;BR /&gt;Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Devneet Mohanty&lt;BR /&gt;Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,&lt;BR /&gt;WonderBotz India Pvt. Ltd.&lt;BR /&gt;Blue Prism Community MVP | Blue Prism 7x Certified Professional&lt;BR /&gt;Website: &lt;A href="https://devneet.github.io/" target="test_blank"&gt;https://devneet.github.io/&lt;/A&gt;&lt;BR /&gt;Email: devneetmohanty07@gmail.com&lt;BR /&gt;&lt;BR /&gt;----------------------------------&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 06 Jun 2022 09:04:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84614#M35727</guid>
      <dc:creator>devneetmohanty07</dc:creator>
      <dc:date>2022-06-06T09:04:00Z</dc:date>
    </item>
    <item>
      <title>RE: SQL query to fetch results for process logging extensively</title>
      <link>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84615#M35728</link>
      <description>&lt;DIV&gt;Devneet,&lt;BR /&gt;&lt;BR /&gt;Process name displaying as Null is occupying the highest space above 300 gb in prod, how to find that name&lt;/DIV&gt;
&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Original Message:&lt;BR /&gt;Sent: 06-06-2022 10:04&lt;BR /&gt;From: Devneet Mohanty&lt;BR /&gt;Subject: SQL query to fetch results for process logging extensively&lt;BR /&gt;&lt;BR /&gt;Hi&lt;BR /&gt;&lt;BR /&gt;Like I said depends on the precision on the values you have with you. If you increase the precision to 38 which is maximum for a decimal you will get the proper value but you need to do it for all the columns:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-plsql"&gt;&lt;CODE&gt;SELECT processname,CONVERT(DECIMAL(38,2),Sum(CONVERT(DECIMAL(38,2), IsNull(DataLength(sessionnumber), 1))+ CONVERT(DECIMAL(38,2), IsNull(DataLength(stageid), 1))+ CONVERT(DECIMAL(38,2), IsNull(DataLength(stagename), 1))+ CONVERT(DECIMAL(38,2), IsNull(DataLength(stagetype), 1))+ CONVERT(DECIMAL(38,2), IsNull(DataLength(processname), 1))+ CONVERT(DECIMAL(38,2), IsNull(DataLength(pagename), 1))+ CONVERT(DECIMAL(38,2), IsNull(DataLength(objectname), 1))+ CONVERT(DECIMAL(38,2), IsNull(DataLength(actionname), 1))+ CONVERT(DECIMAL(38,2), IsNull(DataLength(result), 1))+ CONVERT(DECIMAL(38,2), IsNull(DataLength(resulttype), 1))+ CONVERT(DECIMAL(38,2), IsNull(DataLength(startdatetime), 1))+ CONVERT(DECIMAL(38,2), IsNull(DataLength(enddatetime), 1))+ CONVERT(DECIMAL(38,2), IsNull(DataLength(attributexml), 1))+ CONVERT(DECIMAL(38,2), IsNull(DataLength(automateworkingset), 1))+ CONVERT(DECIMAL(38,2), IsNull(DataLength(targetappname), 1))+ CONVERT(DECIMAL(38,2), IsNull(DataLength(targetappworkingset), 1)))/1073741824) AS session_log_sizeFromBPASessionLog_NonUnicodeGROUP BYprocessnameORDER BY session_log_size DESC​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19032.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19186i0C041CD861E84C5D/image-size/large?v=v2&amp;amp;px=999" role="button" title="19032.png" alt="19032.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;NOTE: If you have very small values even 2 decimal precision will show you 0.00 and won't suffice in that case try with some parameter like&lt;CODE&gt; (38,12)&lt;/CODE&gt;. You need to experiment here and see what fits your use case according to your data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE class="language-plsql"&gt;&lt;CODE&gt;SELECT processname,CONVERT(DECIMAL(38,12),Sum(CONVERT(DECIMAL(38,12), IsNull(DataLength(sessionnumber), 1))+ CONVERT(DECIMAL(38,12), IsNull(DataLength(stageid), 1))+ CONVERT(DECIMAL(38,12), IsNull(DataLength(stagename), 1))+ CONVERT(DECIMAL(38,12), IsNull(DataLength(stagetype), 1))+ CONVERT(DECIMAL(38,12), IsNull(DataLength(processname), 1))+ CONVERT(DECIMAL(38,12), IsNull(DataLength(pagename), 1))+ CONVERT(DECIMAL(38,12), IsNull(DataLength(objectname), 1))+ CONVERT(DECIMAL(38,12), IsNull(DataLength(actionname), 1))+ CONVERT(DECIMAL(38,12), IsNull(DataLength(result), 1))+ CONVERT(DECIMAL(38,12), IsNull(DataLength(resulttype), 1))+ CONVERT(DECIMAL(38,12), IsNull(DataLength(startdatetime), 1))+ CONVERT(DECIMAL(38,12), IsNull(DataLength(enddatetime), 1))+ CONVERT(DECIMAL(38,12), IsNull(DataLength(attributexml), 1))+ CONVERT(DECIMAL(38,12), IsNull(DataLength(automateworkingset), 1))+ CONVERT(DECIMAL(38,12), IsNull(DataLength(targetappname), 1))+ CONVERT(DECIMAL(38,12), IsNull(DataLength(targetappworkingset), 1)))/1073741824) AS session_log_sizeFromBPASessionLog_NonUnicodeGROUP BYprocessnameORDER BY session_log_size DESC​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19033.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19184i3E0ABE1C574D65FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="19033.png" alt="19033.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;----------------------------------&lt;BR /&gt;Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Devneet Mohanty&lt;BR /&gt;Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,&lt;BR /&gt;WonderBotz India Pvt. Ltd.&lt;BR /&gt;Blue Prism Community MVP | Blue Prism 7x Certified Professional&lt;BR /&gt;Website: &lt;A href="https://devneet.github.io/"&gt;https://devneet.github.io/&lt;/A&gt;&lt;BR /&gt;Email: &lt;A href="mailto:devneetmohanty07@gmail.com"&gt;devneetmohanty07@gmail.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;----------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 06 Jun 2022 18:29:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84615#M35728</guid>
      <dc:creator>Saif</dc:creator>
      <dc:date>2022-06-06T18:29:00Z</dc:date>
    </item>
    <item>
      <title>RE: SQL query to fetch results for process logging extensively</title>
      <link>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84616#M35729</link>
      <description>Hi Saif,&lt;BR /&gt;&lt;BR /&gt;This is rather strange to happen. But if it is happening you can refer to the master BPAProcess table that has the list of all the processes in your environment but you need to create a join from the current query till that table itself which can happen only via a secondary table called as BPASession table. The query is as follows:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-sql"&gt;&lt;CODE&gt;SELECT BPAProcess.name,CONVERT(DECIMAL(38,12),Sum(
CONVERT(DECIMAL(38,12), IsNull(DataLength(BPASessionLog_NonUnicode.sessionnumber), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(stageid), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(stagename), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(stagetype), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(processname), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(pagename), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(objectname), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(actionname), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(result), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(resulttype), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(BPASessionLog_NonUnicode.startdatetime), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(BPASessionLog_NonUnicode.enddatetime), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(attributexml), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(automateworkingset), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(targetappname), 1))
+ CONVERT(DECIMAL(38,12), IsNull(DataLength(targetappworkingset), 1))
)/1073741824) AS session_log_size
From
BPASessionLog_NonUnicode INNER JOIN BPASession 
ON BPASessionLog_NonUnicode.sessionnumber = BPASession.sessionnumber INNER JOIN BPAProcess 
ON BPASession.processid = BPAProcess.processid
GROUP BY
BPAProcess.name
ORDER BY session_log_size DESC​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19035.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19188iE050E9E991792664/image-size/large?v=v2&amp;amp;px=999" role="button" title="19035.png" alt="19035.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;----------------------------------&lt;BR /&gt;Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Devneet Mohanty&lt;BR /&gt;Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,&lt;BR /&gt;WonderBotz India Pvt. Ltd.&lt;BR /&gt;Blue Prism Community MVP | Blue Prism 7x Certified Professional&lt;BR /&gt;Website: &lt;A href="https://devneet.github.io/" target="test_blank"&gt;https://devneet.github.io/&lt;/A&gt;&lt;BR /&gt;Email: devneetmohanty07@gmail.com&lt;BR /&gt;&lt;BR /&gt;----------------------------------&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Jun 2022 03:07:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/SQL-query-to-fetch-results-for-process-logging-extensively/m-p/84616#M35729</guid>
      <dc:creator>devneetmohanty07</dc:creator>
      <dc:date>2022-06-07T03:07:00Z</dc:date>
    </item>
  </channel>
</rss>

