Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Error in SQL Server query execution plans

$
0
0

Hello,

I am getting a total cost more than 100% when totaling individual query costs.

This is the query for which I am getting execution plan of 104%.

SQL
declare@datesmalldatetimeSELECTReffdasName,(select((selectcount(*)from[cal_reg].[dbo].[customer]whereupper(Reffd)=upper(main.reffd)andcast(dateassmalldatetime)=@date)+(selectcount(*)from[cal_reg].[dbo].[rep]whereupper(Reffd)=upper(main.Reffd)andcast(dateassmalldatetime)=@date)))asCompleted,(select((selectcount(*)from[cal_reg].[dbo].[customer]whereupper([callAttnd])=upper(main.[Reffd])andcast(dateassmalldatetime)=@date)+(selectcount(*)from[cal_reg].[dbo].[rep]whereupper([CallAttnd])=upper(main.reffd)andcast(dateassmalldatetime)=@date)))asAttended,(SELECT((select((selectcount(*)from[cal_reg].[dbo].[customer]whereupper(Reffd)=upper(...

Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>