Hello,
I have a rather complex question which i hope i can make clear.
Consider these tables:
Desc
------
DescID
SectionID
Name (string)
isText (bit)
isNumber (bit)
Field
-----
FielID
ItemID
valText
valNumber
Item
------
ItemID
SectionID
Section
-------
SectionID
Name
As you can see from these tables a section has a name and one or more items. The Item has one or more fields, the valText and valNumber is used depending on the value in the Desc table.
Let's say i have two desc entries, one using valText the other using valNumber.
What i would like is in one record is the field names accoording to the name value in the desc table and the value accoording to the value in the item table depending on the 'isText' and 'isNumber' fields.
What i do now is get all the items, accoording to a particular section and step by step get the values from the field table checking the 'isText' and 'isNumber' fields form the desc table. but i guess this is way too slow.
I guess the problem is the check with the 'isText' and 'isNumber' fields. Could this be solved with subqueries or stored procs?
It's an SQL server 7 DB and i can use stored procs.
Is this possible and if yes, how?
Thanks,
Vince
I have a rather complex question which i hope i can make clear.
Consider these tables:
Desc
------
DescID
SectionID
Name (string)
isText (bit)
isNumber (bit)
Field
-----
FielID
ItemID
valText
valNumber
Item
------
ItemID
SectionID
Section
-------
SectionID
Name
As you can see from these tables a section has a name and one or more items. The Item has one or more fields, the valText and valNumber is used depending on the value in the Desc table.
Let's say i have two desc entries, one using valText the other using valNumber.
What i would like is in one record is the field names accoording to the name value in the desc table and the value accoording to the value in the item table depending on the 'isText' and 'isNumber' fields.
What i do now is get all the items, accoording to a particular section and step by step get the values from the field table checking the 'isText' and 'isNumber' fields form the desc table. but i guess this is way too slow.
I guess the problem is the check with the 'isText' and 'isNumber' fields. Could this be solved with subqueries or stored procs?
It's an SQL server 7 DB and i can use stored procs.
Is this possible and if yes, how?
Thanks,
Vince