I am dealing with a table that contains both cars and owners (table CO
). I am creating another table to contain attributes for an owner (table OwnerAttributes
), that a user can assign to through a GUI. My problem lies in the fact that owners are not unique and since I am using SQL Server I cannot create a foreign key on them. There is an id in the table, but it identifies the car and owner as a whole.
The idea I had to get around this problem is to create a new table (table Owners
) that contains distinct owners, and then adding a trigger to table CO
that would update the Owners
with any changes. I can then use table Owners
for my OwnerAttributes
table and solve my problem.
The question I want answered is if there is a better way to do this?
I am using a preexisting database, that is heavily used by an old application. The application is hooked up to use the table CO
for owners and cars. There also exists several other tables that use the CO
table. I wish I could split the table into Owners
and Cars
, but the company doesn't want me to spend all my time doing it as there are several more features I need to add to the application.