|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SQL Queryi've a database where huge data is dumped realtime, i'd like to run a query
in DTS which should keep only the last 90 days data and every day delete the 91st day. hope i'm able to explain well. please advise necessary procedure ASAP. No need to do it in DTS - just have a SQL Job that runs daily, executing
something like: delete from murtazastable where datecolumn < dateadd(day,-90,getdate()) But you could look into partitioning options, and have the data get archived off. That way, you get to keep your data, but your main database (for backup purposes) is kept smaller. Show quoteHide quote "murtaza" <murtaz***@lycos.com> wrote in message news:78E2D1F3-88A1-4811-813C-026BC4B67385@microsoft.com... > i've a database where huge data is dumped realtime, i'd like to run a > query > in DTS which should keep only the last 90 days data and every day delete > the > 91st day. > > hope i'm able to explain well. please advise necessary procedure ASAP. Another option if the data is being updated often is to use a trigger that
either arhives or removes the old data. Show quoteHide quote "murtaza" <murtaz***@lycos.com> wrote in message news:78E2D1F3-88A1-4811-813C-026BC4B67385@microsoft.com... > i've a database where huge data is dumped realtime, i'd like to run a > query > in DTS which should keep only the last 90 days data and every day delete > the > 91st day. > > hope i'm able to explain well. please advise necessary procedure ASAP.
Other interesting topics
Help! Users can't connect to database
Concatenation Help with stored procedure using "IN" SQL2005: "Registered Owner" and "Registered Organization" available? which query is more efficent? (oppinion time!) Stored Procedure Help Microsoft's AdventureWorks CTE example - different ordering desired Dynamically use variables in SQL in EXECUTE Need help with this Sql Server - TRN Log shrink or truncate. |
|||||||||||||||||||||||