Re: Need to clear Call table

Dale E. Reed Jr. ( (no email) )
Wed, 22 Jul 1998 11:07:50 -0700

Mark Colasante wrote:
> My Calls table is so large right now that a query to it times out. Can
> I just truncate the Calls table or will this cause problems? Does
> anyone have any stored procs they use to keep only a certain amount of
> call history? If so would you be willing to share those procedures?

Initially, you might want to clean it up by hand. The best way to
do this is just use a statement like this:

Delete From Calls
Where CallDate < '6/1/98'

and then increment the date up and execute it again. Try and only do small
pieces at a time. Eventually, you can use a statement like this in
SQL Executive (running nightly or weekly) to trim out the records:

Delete From Calls
Where DateDiff(Month, CallDate, GetDate()) > 2

This would delete all records older than 2 months.

-- Dale E. Reed Jr.  (       IEA Software, Inc.      |  RadiusNT, Emerald, and NT FAQs Internet Solutions for Today  |