Home > Archive > MS SQL Data Warehousing > November 2006 > How to select last updated data









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to select last updated data
Jay

2006-11-14, 7:14 pm

Thanks in advance
Company has a OCR scanner and it scanns a employee_info sheet.
These scanned data are appended into Empl_info table in SQL Server.
Problem is:
Sometime, employee_info sheet is updated and scanned several times on same
date.
Help:
In Empl_info table I want to collect only last updated employee_info data
per one employee number. Putting time field is not my option.
Somebody mentioned timestamp but I don't quite understand how to use it in
my situation.





Dejan Sarka

2006-11-19, 5:12 am

> In Empl_info table I want to collect only last updated employee_info data
> per one employee number. Putting time field is not my option.
> Somebody mentioned timestamp but I don't quite understand how to use it in
> my situation.


Well, you need something to distinguish different loads. Either is this
batch id, or datetime of the load. Timestamp (sysnonym rowversion) is not
useful in this situation, because SQL Server updates it for every Update
statement, and therefore you can lose your load identification.

--
Dejan Sarka
http://www. solidqualitylearning
.com/blogs/



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com