Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 SQL SERVER 2008 Performance Related Issue

Author  Topic 

kond.mohan
Posting Yak Master

213 Posts

Posted - 2012-03-02 : 03:05:00


Hi,

i am executing SELECT statement

select statement one of column(OUTSTANDING_AMT)have case statement like this
-----------------------
CASE WHEN dcmm.BILL_LODG_AMT > (DCMM.current_value * ((DCMM.ACTL_TOLERANCE_PCNT + 100)/100))+ DCMM.INTEREST_ADDTNL_AMT
THEN 0
ELSE (case when (((DCMM.current_value * ((DCMM.ACTL_TOLERANCE_PCNT + 100)/100)) - DCMM.BILL_LODG_AMT - DCMM.DC_NOBILL_UTIL_AMT+ DCMM.INTEREST_ADDTNL_AMT)
+ dcmm.DC_REINST_AMT <0) THEN 0
ELSE ((DCMM.current_value * ((DCMM.ACTL_TOLERANCE_PCNT + 100)/100)) - DCMM.BILL_LODG_AMT - DCMM.DC_NOBILL_UTIL_AMT + DCMM.INTEREST_ADDTNL_AMT )
+ dcmm.DC_REINST_AMT END)end 'Outstanding Amount',
-----------------------

my query have 20 columns
and remaining columns have not calculations

and i included where clause criteria complete outstainding amount coulun for getting

outstanding Amount> 0

report have 6000 records

how to reducue the query execution time

query has taking to execute so much time

   

- Advertisement -