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 |
babu.knb
Starting Member
2 Posts |
Posted - 2007-03-16 : 06:55:54
|
Hi, Records are added to a table which can grow in millions with date of the creation. Views (also cascade of views) is used to calculate the grouped data:for example:1) here is a view to calculate aggregate data:CREATE VIEW dbo.All_Campaign_Calls ASSELECT TOP 100 PERCENT NUMCAMPAGNE AS Campaign_Num, OWNERNAME AS owner_name, STATUTPROSPECT AS STATUS, CAST(CONVERT(varchar(10), DATESELECT, 103) ASdatetime) AS call_dateFROM dbo.ProspectCampagneWHERE (APPELE = '1')this view shows from a prospect table for a given campagne, by date and by person used to call2) here a view that uses the previous view to aggregate data: number of calls by date:SELECT TOP 100 PERCENT Campaign_Num, call_date, SUM(nb_Total_Calls) AS nb_Total_Calls_day FROM dbo.Calls_Per_Campaign_Date_StatusGROUP BY Campaign_Num, call_dateORDER BY Campaign_Num, call_date3) here is a view that uses other views to agrregate data by data AND by person called:SELECT TOP 100 PERCENT Campaign_Num, call_date, STATUS, SUM(Nb_Calls) AS nb_Total_Calls FROM dbo.Calls_Per_Campaign_Dt_Own_StatGROUP BY Campaign_Num, call_date, STATUS ORDER BY Campaign_Num, call_date, STATUSetc.....In SQL server DB; do the calculations:We have views that gather, agregate data...To know the performance of the server with 100k, 500k, 1M 2, 3, 4 million records ??How to find that one ??Regards Babu B |
|
pootle_flump
1064 Posts |
Posted - 2007-03-16 : 07:17:20
|
@respondents FYIhttp://www.dbforums.com/showthread.php?p=6262070#post6262070 |
|
|
|
|
|
|
|