Hi Wayne,
Sorry for the unclear Q. My intention is to write wrapper functions to sychronize VFP data and SQLServer data. Both having same tables and fields names. (some sort like replication but 1 set is VFP and another is SQLServer) In fact I have proceeded with method 2 and testing it. The wrapper functions will have parameters like table name, primary fields, fields to replace, where clause, insert flag and override flag. That was my intention.
Regards.
>>Hi all,
>>
>>Which is the better ways? (see below)
>>
>>Method 1:
>>Retrieve all records of the sqlserver table. Index the view, and seek if record from vfp exist in this view. If not, SQLEXEC to insert.
>
>I don't know why you would ever want to do this.
>
>>
>>Method 2:
>>SQLEXEC with SELECT with the WHERE clause for the pk. If not record, SQLEXEC to insert.
>
>This would not take more than a split second.
>
>>
>>If there is better way, please advise. The tables will be big.
>>
>>Regards.
>
>
>I'm kinda confused-are you just looking for an unused primary key? Or do you just know the key and want to insert it - but want to make sure it is not there? Either way, it seems kind of a weired scenario.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement