Bobby Heid
bheid at appdevgrp.com
Fri Nov 11 13:36:51 CST 2005
First of all, do you mean the 1st 60% of the records? Last 60%, etc? I think I would capture all of the events for the day and have a nightly SPROC that goes through and processes the particular 60% that you wanted. Maybe store a random number in an extra field and when you go to process it, sort the table by the random number and count the number of records and then take the top 60% of them and write them out to the event table. If you have a very high volume, this may not be a good way. A lot really depends on which 50% of the records you want. Like in your example, you could write 6, skip 4, write 6, etc. Bobby -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Hale, Jim Sent: Friday, November 11, 2005 2:10 PM To: 'Accessd (E-mail) Subject: [AccessD] Trigger help Assume a large SQL Server database where actions by many employees can be captured. Assume you only want to capture (ie write to the datasbase) 60% of the events. Of course you don't know the total number of events that will occur during the day so the best thing to do is write the first 6 of every ten. I've not used SQL server so I'm not sure the proper way to count the hits (candidate records) and write six and discard four. What is the efficient way to do this in SQL server? TIA Jim Hale