Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
smitha
Posting Yak Master
100 Posts |
Posted - 2010-11-10 : 07:07:41
|
| How to purge the 4 months old data when the data is continuously logging in sql tables?Smitha |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-11-10 : 07:18:32
|
Do you have a column to decide how old a row is?What is the datatype of that column?Example data? No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
smitha
Posting Yak Master
100 Posts |
Posted - 2010-11-10 : 07:41:36
|
| the datatype is date, time and numericsSmitha |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-11-10 : 07:48:23
|
DELETE YourTableWHERE YourDateColumn < DATEADD(MONTH,-4,GETDATE())You can also check if the WHERE clause is ok by having a look at the selected data firstSELECT * FROM YourTableWHERE YourDateColumn < DATEADD(MONTH,-4,GETDATE()) No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
Sachin.Nand
2937 Posts |
|
|
smitha
Posting Yak Master
100 Posts |
Posted - 2010-11-11 : 03:01:11
|
| is there any settings in sql database to purge the data, instead of writing the querySmitha |
 |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-11-11 : 03:07:00
|
quote: Originally posted by smitha is there any settings in sql database to purge the data, instead of writing the querySmitha
Did you went through the link I posted?PBUH |
 |
|
|
|
|
|