Author |
Topic |
Prabhat
Starting Member
7 Posts |
Posted - 2008-07-23 : 07:24:01
|
Hi all i want to know , how we can check the updated field or inserted field in a table ,or Can we check which rows inserted today into table by date I m using sql 2000 and i want to select rows which is inserted today what there r any property to check it by date Plz help its urgent for me ThxP Tyagi |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-23 : 07:30:23
|
by updated/inserted field due you mean values from inserted table? if yes, this can be accesed either inside triggers or using the OUTPUT clause available in 2005. If not,please explain what you're looking at.the rows inserted today can be checked easily if you've an audit column like datemodified. just useselect * from yourtable where datemodified=dateadd(d,datediff(d,0,getdate()),0) |
 |
|
Prabhat
Starting Member
7 Posts |
Posted - 2008-07-23 : 07:54:59
|
quote: Originally posted by Prabhat Hi all i want to know , how we can check the updated field or inserted field in a table ,or Can we check which rows inserted today into table by date I m using sql 2000 and i want to select rows which is inserted today what there r any property to check it by date Plz help its urgent for me ThxP Tyagi
Please replyP Tyagi |
 |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-07-23 : 07:57:35
|
yes if you have a datetime column that holds this information .otherwise no._______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.0 out! |
 |
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2008-07-23 : 07:58:21
|
?? you got a reply? what didn't you like about it?Em |
 |
|
Prabhat
Starting Member
7 Posts |
Posted - 2008-07-23 : 08:03:04
|
okP Tyagi |
 |
|
aoriju
Posting Yak Master
156 Posts |
Posted - 2008-07-23 : 08:14:17
|
select * from yourtable where datemodified = getdate()quote: Originally posted by visakh16 by updated/inserted field due you mean values from inserted table? if yes, this can be accesed either inside triggers or using the OUTPUT clause available in 2005. If not,please explain what you're looking at.the rows inserted today can be checked easily if you've an audit column like datemodified. just useselect * from yourtable where datemodified=dateadd(d,datediff(d,0,getdate()),0)
|
 |
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2008-07-23 : 08:16:29
|
you don't really think that would work do you?quote: Originally posted by aoriju select * from yourtable where datemodified = getdate()quote: Originally posted by visakh16 by updated/inserted field due you mean values from inserted table? if yes, this can be accesed either inside triggers or using the OUTPUT clause available in 2005. If not,please explain what you're looking at.the rows inserted today can be checked easily if you've an audit column like datemodified. just useselect * from yourtable where datemodified=dateadd(d,datediff(d,0,getdate()),0)
Em |
 |
|
|