Timestamp column - SQL Server -> Dataset -> Temp Table using Openxml -> Update Table based on timestamp column

  • I have a timestamp column in a table for checking for concurrent updates.

    I get the data to a typed dataset.  In order to update i convert the dataset to xml (using dataset.getxml()) and pass it to stored proc.

    In the stored proc i am storing the data from xml string into a temp table using openxml.  The values of timestamp column from xml are stored in Varbinary(8) column in temp table.

    When i compare the rowversion column in the temp table and main table, they are not matching.  For some reason the values are different when i pass it to dataset and back to sql server.

    How can resolve this issue?  Please help.

    Thanks in advance.

    Venu.

  • I would suggest that your conversion from the binary timestamp format to a string (as part of the XML) and back is corrupting it somehow... Can you examine the value at intermediate steps?  EG, examine it as part of the raw .NET dataset (I assume you are writing in .NET as you mention typed datasets).  Then also examine the raw XML that your dataset creates.  Then exame the XML as it arrives at SQL Server....  Somewhere in one of those steps you might be interpreting the data as string when it should be binary, etc..

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply