>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.
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown