>I wanted to run by you all the approach I am thinking to implement to have the application validate user entry in several records.
>
>Here is briefly how the application work. User enters several records of data in a cursor (in VFP application). I need to validate that the entries in the key field exist in a table in database. Here is the plan:
>
>1. Convert data entry cursor to an XML string.
>2. Pass XML string to a Stored Procedure.
>3. In the Stored Procedure, the XML string is converted to a TEMP cursor (honestly I don't know if it could be done in SQL Server SP though).
>4. Then, in the same Store Procedure, a SQL Select is created against the table in the database with JOIN to the TEMP cursor/table.
>5. Compare results of the SQL Select with the TEMP cursor to see if all values in TEMP cursor were found in the table.
>6. Return XML string with the values Not found in the table.
>
>Does the above seem like the right approach?
>
>If you have any better suggestion, please let me know.
>
>Thank you in advance.
Dmitry,
Though you could do that I think XML conversion is an unnecessary and consumes more bandwidth. Cehck for a sample joining VFP tables with SQL tables using different approaches (temp table and openrowset):
Re: Joining remote table with local cursor Thread #
921514 Message #
921530Cetin