Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Overloaded Tables
Message
From
30/06/2011 08:03:43
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
30/06/2011 07:23:19
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01516837
Message ID:
01516843
Views:
59
>Novice question about MS SqlServer.
>
>I have an application which uses what I call an "overloaded" table. By that I mean that it contains columns of relational key ID's that can relate to different tables depending on another definitive field in the table. For example, x1_ID relates the record to an Invoice header if the xntype field value is "CHARGE" or "PAYMENT" but if the xntype field value is "INVRECEIVE", x1_ID relates the record to a Purchase Order Header record.
>
>This structure has worked well for me for several years in VFP but I have been told that it is not allowed in a SQL Server table. Have I been misinformed or have I been misusing this capability in VFP ?

SQL server doesn't know your semantics. The verdict may have come from a purist guru, who may not like that kind of design, but that won't stop it from working. You may not set two foreign key restraints on the same field, but you didn't do it in VFP either, so what.

You can always join on that field to one table for one condition, to another table for a different condition etc, even in the same select statement. A tad more complicated - but you solved that in VFP already, so just repeat that in SQL.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform