I am trying to use the Database unit tests in Visual Studio 2010. I created a test where I am using checksum to validate the result set in one of my tables. If I tested on the data it works fine until I delete the rows and reload the same data. I am not including any field that could change (identities, derived dates, etc) which would obviously change the checksum output.

Is there something I need to do so I can implement this? It would be really nice ot have it validate the 20+ rows in the table using the checksum.

I would not use checksum at all, because you don't know what went wrong if your checksum does not match. Is there one value wrong, are your rows in wrong order, or is one row missing? Checksum does not answer such questions. As such, it is not very useful.
–
A-KFeb 22 '12 at 18:40

@AlexKuznetsov - CHECKSUM works against a single row, so row order would not affect it. CHECKSUM_AGG works against multiple rows, but is documented to not be affected by row order.
–
Damien_The_UnbelieverFeb 22 '12 at 19:31

@Damien_The_Unbeliever my point is different: when checksum is not as expected, we still have to figure out whether all the columns in a row are totally wrong or we have 1.59997 instead of 1.6 in one column and all others match. As such, we have to waste time determining what exactly went wrong. So typically checksum approach is just not good enough.
–
A-KFeb 22 '12 at 22:43

We would, again, need to see some actual code. CHECKSUM does work, generally, it's not like it includes some hidden information about table rows, so we've not been given enough information to answer your question, as yet.
–
Damien_The_UnbelieverFeb 22 '12 at 17:56

Hi @Damien_The_Unbeliever I will try to add some to the question so you can see where I am maybe going wrong
–
scarpacciFeb 22 '12 at 18:32