Help please, I'm always getting this message:
There are no primary or candidate keys in the referenced table 'factIngresosCurso' that match the referencing column list in the foreign key 'fk_ingresos_curso'.
My tables:
create table factIngresos
(
cicCod char(6),
curcod char(5) references dimCurso,
cursec char(2),
codSec char(1) references dimSeccion,
tiempoid int references dimTiempo,
codHor int references dimHorario,
proCodUno char(5) references dimPersonal,
vacantes int,
inscritos int,
ingresoProyectado money,
ingresoNeto money,
becas money default 0,
constraint pk_Ingresos primary key(cicCod, curCod, curSec)
)
go
create table factIngCursoAlumno
(
alucod char(8) references dimAlumno,
cursec char(2), ciccod char(6), curcod char(5),
alucurCosto float, alucurefe float,
alucurPF float,
constraint pk_facIC primary key(alucod, cursec, ciccod, curcod),
constraint fk_ingresos_curso
foreign key(cursec, ciccod, curcod) references factIngresos(cursec, ciccod, curcod)
)
go