|
Posted by Alexander Kuznetsov on 12/09/05 21:52
i'd do it the other way around:
create table c(c int primary key,
c_type char(1) not null check(c_type in ('A', 'B')),
unique (c, c_type))
go
create table a(
c int not null,
c_type char(1) not null check(c_type = 'A'),
foreign key(c, c_type) references c(c,c_type))
go
create table b(
c int not null,
c_type char(1) not null check(c_type = 'B'),
foreign key(c, c_type) references c(c,c_type))
go
drop table a
drop table b
drop table c
[Back to original message]
|