Table is growing too big

I have a table that receives data every second.  What I need to do is limit the size of the table so it stops growing ( I cannot change the time for input ). We do not need to keep this many records and I have decided on the time frame to keep. What I would like to do is create a trigger that after INSERT, DELETES the oldest row, I assume this will keep the table at the size I want. Any suggestions for code? Will the INSERT and DELETE trigger slow down the DB because its every second? Or is there another way to accomplish this with as little impact as possible. I just need a starting point!
dennisjameshowardAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

chapmandewCommented:
A good way to do this is to use partitioning in 2005 to easily swap out old records...
0
Scott PletcherSenior DBACommented:
A trigger would be too much overhead.

First, cluster the table by the datetime of insert.

Then you can have a job that runs every <whatever> minutes that deletes the oldest <whatever> minutes of data.

That should reduce the impact as much as reasonably possible.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.