Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select to compare two tables
Message
De
29/01/2022 20:17:34
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01683376
Message ID:
01683388
Vues:
23
A ROWVERSION data type is used in many SQL applications. It's a binary number that SQL assigns when you insert/update a row.

People use it to synchronize tables. If you have a common key across two tables, and you match up the rows based on key....if the rowversion value in Table A is the same as Table B, then you can be assured that no columns are different in B.

But if the rowversions differ, that means "something" is different between the two tables.

OK, I'll say this as delicately as I can. If at all possible, you should take a step back and see what is available in SQL Server. Now, maybe you're stuck with this current structure and don't have any choice in the matter, and I get that. In that case, you're going have to do a brute force comparison. But if you *can* change how this has been set up, there are many features in SQL Server you could take advantage of






>Yes, I am trying to compare ALL columns.
>I don't know what ROWVersion is. And since I don't know it, the tables probably do not have it.
>The tables have a PK but it is a Identity Column so it is meaningless for this comparison.
>
>>OK, so you're trying to compare "all" the columns....not just the ID number?
>>
>>I'm going to take a guess that your SQL tables don't have a ROWVersion column (which would greatly help here)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform