Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Newbie ? on validating user input
Message
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Newbie ? on validating user input
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01162741
Message ID:
01162741
Views:
50
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.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Next
Reply
Map
View

Click here to load this message in the networking platform