Hi,
I'm going to explain as clearly as possible:
I have two tables:
Relationships(relation_id, table1, table2)
Relationfields(relation_id, field1, field2)
In Relationships, relation_id is the primary key
In Relationfields, relation_id is the foreign key
I have a front-end interface that allows the user to add records to
Relationships and Relationfields as followed:
The user selects a table1 and table2 values from listboxes. These are
real table names from sys.objects, so then the user can select fields
of these tables on which he wants to create a JOIN.
Anyway, I can easily insert the table1 and table2 into Relationships
(relation_id is an auto-increment). Then I need to get the relation_id
of this new Relationship (easy since I know which values I've inserted
and table1-table2 associations are unique.
Now the PROBLEM :
I need to insert into Relationfields all the fields selectioned by the
user for each of the two tables . But the user might have selected
several fields from table1 and table2, so I need to pass A LIST
PARAMETER to my Stored Procedure as I don't know how many values of
field1 and field2 there is going to be.
I hope this is clear enough. Is it possible to achieve what I want ?
Should I pass an entire concatenated string with values separated by
comma or whatever and then decrypt it in the stored procedure ?
Thx