Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6770363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:18:12+00:00 2026-05-26T15:18:12+00:00

Is it possible to set up the MS SQL-Server to delete the oldest rows

  • 0

Is it possible to set up the MS SQL-Server to delete the oldest rows from a table when it grows too large? If not, should I use some sort of trigger or should this be a timed event in the application side?

My situation is that I have just implemented a logging solution for a web application. It is a requirement to log a lot of information, so the database will grow too large in a year or so, and I have a feeling that there will be nobody to maintain the database. Looking for the best solution for this problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:18:13+00:00Added an answer on May 26, 2026 at 3:18 pm

    Rather than trying to determine ahead of time what too large is, I would suggest that you define a business rule somewhere (stored procedure, configuration table, etc) that can be set to control how many days worth of logging to keep.

    You can then schedule a job to run nightly through SQL Server that will delete all log records older than the specified criteria.

    This way, you and your users will know exactly what to expect from the logging system (i.e. you will only have access to the log files for 30 days).

    If you combine this with a regular backup strategy, then in the event that older records are needed, they could be retrieved from backups.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In SQL Server , it is possible to insert rows into a table with
Is it possible to set up somehow Microsoft SQL Server to run a stored
In SQL Server (2000 or 2005) is it possible to set the database or
With SQL Server 2005 and 2008 is it possible to set the default schema
Is it possible to create unclustered indexes in SQL Server 2005 that are not
Is it possible to set up SQL Server with a web service to receive
I'd like if its possible to work out from inside sql server how long
Is it possible with NHibernate and Sql Server to insert an entity and set
We develop a set of industrial applications that use SQL Server. As demand expands,
Is it possible in SQL (SQL Server) to retrieve the next ID (integer) from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.