Re: How to select last updated data

Tech-Archive recommends: Fix windows errors by optimizing your registry



Use a group by query on Emp_ID, Max (ScanID)

Colin R






"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@xxxxxxxxxx> wrote in
message news:e78J9L7CHHA.4952@xxxxxxxxxxxxxxxxxxxxxxx
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/




.