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
 General SQL Server Forums
 New to SQL Server Programming
 metric report in SQL server2005

Author  Topic 

qutesanju
Posting Yak Master

193 Posts

Posted - 2010-03-30 : 03:01:57
Hi
I have these queries
--1-------------
select 'PROD_WASTE' as 'Table_Name' ,count (*) as 'Table_Count'from dbo.[PROD_WASTE]
--2--------------------
Declare @LastRunDate as varchar(100);
set @LastRunDate='2006-03-31';
select 'PROD_WASTE' as 'Table_Name' ,count (*) as 'rows got deleted' from
(
SELECT * FROM dbo.[KC_PROD_WASTE] where [PROD_WASTE_MES_PRODU_DATE_D] <= @LastRunDate
)B
--3----------------
select 'PROD_WASTE' as 'Table_Name' ,count (*) as 'actual remaing rows in table' from
(
SELECT * FROM dbo.[PROD_WASTE] where [PROD_WASTE_MES_PRODU_DATE_D] > @LastRunDate
)B

and I want to generate one matrix report like below

Prod_Waste prod_summery prod_delay
toal_count 200 45 100
rows_got_deleted 100 40 50
remaining_rows_after_delete 100 06 50
(total_count-rows_got_deleted)
actual_remaing_rows_in_table 100 10 50
check TRUE FALSE TRUE
(CHECK will be True if remaining_rows_after_delete=actual_remaing_rows_in_table ELSE false )

qutesanju
Posting Yak Master

193 Posts

Posted - 2010-03-30 : 11:25:35
i guess this is based on metrix report in SQL
Go to Top of Page

qutesanju
Posting Yak Master

193 Posts

Posted - 2010-03-31 : 02:54:36
I guess below thing will be more clear if you copy this into excel sheet
--------------------------------
table name Prod_Waste prod_summery prod_delay
toal_count 200 45 100
rows_got_deleted 100 40 50
remaining_rows_after_delete 100 06 50
(total_count-rows_got_deleted)
actual_remaing_rows_in_table 100 10 50
check TRUE FALSE TRUE
(CHECK will be True if remaining_rows_after_delete=actual_remaing_rows_in_table ELSE false )
Go to Top of Page

qutesanju
Posting Yak Master

193 Posts

Posted - 2010-03-31 : 06:51:44
kindly advise
Go to Top of Page
   

- Advertisement -