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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-04-18 : 09:34:46
|
| K. Amith Kumar writes "Hi,I wanted to know which row was last updated in a table?And I wanted to Select that row and use in my later programming.Please help me it is very important for me to solve this." |
|
|
KenW
Constraint Violating Yak Guru
391 Posts |
Posted - 2006-04-18 : 09:36:31
|
| SQL Server has no concept of "which row was updated last", I'm afraid. Unless there's something in your data which will indicate the order the rows were added, you're out of luck. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-04-18 : 09:40:39
|
| If you use DateTime column you can query based on the maximum of itMadhivananFailing to plan is Planning to fail |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-04-18 : 09:50:12
|
You can use a column with datetime data type that get updates with getdate() everytime a records is updated (insert / update trigger) KH |
 |
|
|
a_r_satish
Yak Posting Veteran
84 Posts |
Posted - 2006-04-19 : 04:52:21
|
| use a column with datatype and for every update/insert use getdate() to fill the column.Now u can use that column to find the last changed rowsatish.r"Way to success is always under Construction" |
 |
|
|
mahesh_bote
Constraint Violating Yak Guru
298 Posts |
Posted - 2006-04-20 : 08:26:30
|
| I will suggest "After Insert / After Update Trigger" in this case. Insert such updated rows in New table and get such values for further programming.BMahesh |
 |
|
|
|
|
|