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 |
|
eddy556
Starting Member
36 Posts |
Posted - 2009-01-05 : 04:30:24
|
| Is it possible to query for all records which have been, say, added or updated within the past week? |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-01-05 : 04:35:51
|
| u want to get the records which are updated r inserted with in lastweekif u have any date column in urtable u can get the details by where condtion on that datecolumn |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-05 : 04:58:36
|
| best way to deal with this is to use audit trail columns like lastupdated,datecreated...If you cant change structure of main table, consider creating an audit table to track changes in main table |
 |
|
|
eddy556
Starting Member
36 Posts |
Posted - 2009-01-05 : 07:05:19
|
| Many thanks, this is what I was thinking.However is there NO other way of doing this? i.e. asking the database itself to return any records edited within the last week, or is such data not stored? |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-01-05 : 07:12:51
|
| I think no other way only if the datecolumn is present in the table then only we can get the records of last week |
 |
|
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2009-01-05 : 07:27:05
|
| or upgrade to 2008 which has 'change data capture' built inEm |
 |
|
|
|
|
|