[AccessD] Trigger help

Hale, Jim Jim.Hale at FleetPride.com
Fri Nov 11 14:03:53 CST 2005


The object is to not process 40% of the records at all. They do not need a
random sample so the first 6 of each 10 would suffice. The volume is so high
the client wants to skip doing anything with 40% of the universe of possible
records. 60% is an adequate sample for what they need. In SQL Server how
does one identify a record before it is written to the database and
determine if it is the 2nd or 9th record? Something analgous to running a
counter function in the before update event of an Access table
Jim Hale

-----Original Message-----
From: Bobby Heid [mailto:bheid at appdevgrp.com]
Sent: Friday, November 11, 2005 1:37 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Trigger help


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

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

***********************************************************************
The information transmitted is intended solely for the individual or
entity to which it is addressed and may contain confidential and/or
privileged material. Any review, retransmission, dissemination or
other use of or taking action in reliance upon this information by
persons or entities other than the intended recipient is prohibited.
If you have received this email in error please contact the sender and
delete the material from any computer. As a recipient of this email,
you are responsible for screening its contents and the contents of any
attachments for the presence of viruses. No liability is accepted for
any damages caused by any virus transmitted by this email.


More information about the AccessD mailing list