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
 reporting

Author  Topic 

mitasid
Yak Posting Veteran

51 Posts

Posted - 2006-06-07 : 21:48:14

i need to generate a report on the foll tables
here is the sample data for the report output..hope it makes it more clear now...

table 1
Companyname id year volume_for_jan vol_for_feb.....vol_dec
abc 1 2000 34 333 ......555
2 2000 33 22 666

table 2
Companyname id year volume_for_jan vol_for_feb.....vol_dec
rrr 44 2001 55 66.............888
24 2001 22 35 454

each table has almost 800000 rows

I need to generate a report out of these tables which should be as follows

Company name Id Year Vol_for_jan Vol_for_feb.........
abc 1 2000 34 33
2 2000 33 22
rrr 44 2001 55 66
..................................................

when i try to run the report in business intelligence ,it takes forever to run and doesnt even produce the report at the end...

i dont have any primary key or indexes on these tables
because when i try to insert an auto no field into the table, sql does not let me do that

what shall i do????

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-07 : 21:58:18
[code]select CompanyName, id, year, vol_for_jan, vol_for_feb, . . .
from table1
union all
select CompanyName, id, year, vol_for_jan, vol_for_feb, . . .
from table2[/code]

"i dont have any primary key or indexes on these tables
because when i try to insert an auto no field into the table, sql does not let me do that"

Can you elaborate more on this ?


KH

Go to Top of Page

mitasid
Yak Posting Veteran

51 Posts

Posted - 2006-06-07 : 22:03:29
yes because each table has got about a million records and when i try to run the report,it takes ages to process and at the end nothing happens..
i dont know how to create such a report which should at least process in half an hour or so?

Go to Top of Page
   

- Advertisement -