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
 Script Library
 Query Help

Author  Topic 

houghjohnny
Starting Member

4 Posts

Posted - 2011-03-25 : 19:12:47
I am getting ready to create a local partition view on a table that has approximately 3 billion rows the goal is to create 40 new DB and partition this table accross the 40 DB each table will hold approximately 75 million rows. The partitioning column I am using is a int there are no timestamp columns in this table my dilemna is this. I need help writing a query that will give me three columns here is an example of the data I want to retrieve I already have the first two columns down I just need help populating the third colum (CummulativeMailCount)



groupid NumberOfMails CummulativeMailCount
51765 48 48
51764 119 167
51750 14656 14823
51749 1691 16514
51748 48964 65478


I want the cummulative mail count to increment all previous groupid number of mails until it gets to 75 million than I would like it to reset and start over until it gets to 75 million again the reason I need this is so I can create the check constraints for the partitioned tables. Please help I hope this question is clear if further explanation is needed I can gladly oblige thanks ahead for any help you can provide.
   

- Advertisement -