I am trying to get the last Id using the max (Id) function, where Id is the primary key. My code works well if I do not delete the last row from the table, because when I delete the last row, this identifier is saved and in this case max (Id) will extract the last row identifier, but not the identifier that is deleted from the table.
Is there any function that retrieves the remote id of the last line. I saw several posts using functions scope_identity()and @@identityto get the current identifier. I used these functions, but they do not work. I am editing my code inside a dll file, maybe this is a problem.
source
share