Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-02-16 : 08:08:46
|
John writes "I have an application where the client is storing items in a main Items Table based on a category. I have an add item page which is currently built dynamically based on a table that holds all of the required fields, this table is called FormFields. It contains a field for the text description of each required field, what type of input field i.e. text, textarea, radio, or select as well as the size of the field. Once all of the fields have been entered and the form is submitted the data for this part must be checked to see if the item already exists in the main Items table. The idea I had was to use the same FormFields table to build the Query to check against the Main Items table if an Item already exists with the same exact entered features. The problem is that the required fields for an item could be as few as three or as many as seven. Do I build a dynamic select query with sub queries or should I use the ANY and SOME commands in my query to check for the existence of that item. The FormFields table also tells me what type of data types the required fields are so that I know if I have to wrap text in single quotes. One idea I had was to build a temp table of the Items based on the main category that the item belongs to and some how go thru all of my fields that I need to check against and some how do a process of elimination and remove or mark the records that have the same fields and then take a count of how many un-checked or remaining records still exist. I have looked thru a lot of sites and have never found a solution for a similar problem like this where you need to check for exisitng records based on unknown amount of conditions.
Thank You John V" |
|
|
|
|
|