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.
| Author |
Topic |
|
mitasid
Yak Posting Veteran
51 Posts |
Posted - 2006-06-07 : 21:48:14
|
| i need to generate a report on the foll tableshere is the sample data for the report output..hope it makes it more clear now...table 1Companyname id year volume_for_jan vol_for_feb.....vol_decabc 1 2000 34 333 ......5552 2000 33 22 666table 2Companyname id year volume_for_jan vol_for_feb.....vol_decrrr 44 2001 55 66.............88824 2001 22 35 454each table has almost 800000 rowsI need to generate a report out of these tables which should be as followsCompany name Id Year Vol_for_jan Vol_for_feb.........abc 1 2000 34 33 2 2000 33 22rrr 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 tablesbecause when i try to insert an auto no field into the table, sql does not let me do thatwhat 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 table1union allselect CompanyName, id, year, vol_for_jan, vol_for_feb, . . . from table2[/code]"i dont have any primary key or indexes on these tablesbecause 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 |
 |
|
|
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? |
 |
|
|
|
|
|
|
|