1
Answer

finding the highest version of data in sql server table

satish babu

satish babu

11y
972
1
Hi all,hi i have small doubt.I have table like this

 column name      datatype
 -----------------    ----------------
    date               date
    version           varchar(50)
     name1           varchar(50)
   
     date       version   name1
  25/5/2013 1.1           A
  25/5/2013 1.2           B
  24/5/2013 2.5           C
  24/5/2013  2.0          D
 
I want to find the max version record of that day.Can u give me any suggestion abt to find the max vesrion of record?
Answers (1)
1
Amit Gupta

Amit Gupta

NA 16.5k 25.7k 8y
When any rows gets deleted, it still exists in the datatable untill dt.AcceptChanges () was called.
 
You can access the deleted rows by using below snippet
  1. if (dataRow.RowState == DataRowState.Deleted)  
  2.     id = (string)dataRow["EmpId", DataRowVersion.Original];