<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Generate Random Values &#8211; SQL in Sixty Seconds #042 &#8211; Video</title>
	<atom:link href="http://blog.sqlauthority.com/2013/02/06/sql-server-generate-random-values-sql-in-sixty-seconds-042-video/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2013/02/06/sql-server-generate-random-values-sql-in-sixty-seconds-042-video/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Wed, 22 May 2013 19:03:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Prashant</title>
		<link>http://blog.sqlauthority.com/2013/02/06/sql-server-generate-random-values-sql-in-sixty-seconds-042-video/#comment-446349</link>
		<dc:creator><![CDATA[Prashant]]></dc:creator>
		<pubDate>Fri, 29 Mar 2013 04:51:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=22604#comment-446349</guid>
		<description><![CDATA[Dear Pinal,

I am giving one of example of Sql query which I used in SSRS Report. In below example used few sub queries to achieve result. But few more queries are there where lot of sub queries used(15-20) in same manner. Basically what we want the count of record based on different condition. Because of lot of sub queries used in Sql queries its taking lot of time to execute (Performance issue). Is there are any alternate way to achieve same result within minimum time of execution.Please give valuable suggestion/solution.

Example: 
SELECT FI.Name,
(SELECT COUNT(*) FROM FilterIncidentTrans AS FIT
WHERE FIT.IsPunUnits=1 AND FIT.RecId=FI.RecId) AS [PUN UNITS COUNT],
(SELECT COUNT(*) FROM FilterIncidentTrans AS FIT
WHERE FIT.IsREBELUnits=1 AND FIT.RecId=FI.RecId) AS [REBEL UNITS COUNT],
(SELECT COUNT(*) FROM FilterIncidentTrans AS FIT
WHERE FIT.IsOtherUnits=1 AND FIT.RecId=FI.RecId) AS [Other UNITS COUNT]
FROM FilterIncident AS FI
WHERE FI.StartDate=@StartDate and FI.EndDate=@EndDate]]></description>
		<content:encoded><![CDATA[<p>Dear Pinal,</p>
<p>I am giving one of example of Sql query which I used in SSRS Report. In below example used few sub queries to achieve result. But few more queries are there where lot of sub queries used(15-20) in same manner. Basically what we want the count of record based on different condition. Because of lot of sub queries used in Sql queries its taking lot of time to execute (Performance issue). Is there are any alternate way to achieve same result within minimum time of execution.Please give valuable suggestion/solution.</p>
<p>Example:<br />
SELECT FI.Name,<br />
(SELECT COUNT(*) FROM FilterIncidentTrans AS FIT<br />
WHERE FIT.IsPunUnits=1 AND FIT.RecId=FI.RecId) AS [PUN UNITS COUNT],<br />
(SELECT COUNT(*) FROM FilterIncidentTrans AS FIT<br />
WHERE FIT.IsREBELUnits=1 AND FIT.RecId=FI.RecId) AS [REBEL UNITS COUNT],<br />
(SELECT COUNT(*) FROM FilterIncidentTrans AS FIT<br />
WHERE FIT.IsOtherUnits=1 AND FIT.RecId=FI.RecId) AS [Other UNITS COUNT]<br />
FROM FilterIncident AS FI<br />
WHERE FI.StartDate=@StartDate and FI.EndDate=@EndDate</p>
]]></content:encoded>
	</item>
</channel>
</rss>
