No se que puede estar faltando, tengo tres tablas, intento que una de ellas solo contenga dos llaves foraneas (foreign key) y que se vaya actulizando conforme a las llaves primarias (Primary key) de las otras dos tablas correspondientes sin embargo no actualiza la tabla llamada principal , esta en sql server 2000 y aqui esta el código de cada una:
Tabla llamada principal con 2 llaves foraneas
Código:
Tabla llmada pricipal1 con 1 llave primariaCREATE TABLE [principal] ( [foranea1] [char] (10) COLLATE Modern_Spanish_CI_AS NOT NULL , [locales1] [char] (10) COLLATE Modern_Spanish_CI_AS NOT NULL , CONSTRAINT [PK_principal] PRIMARY KEY NONCLUSTERED ( [foranea1], [locales1] ) ON [PRIMARY] , CONSTRAINT [FK_principal_principal11] FOREIGN KEY ( [foranea1] ) REFERENCES [principal1] ( [foranea1] ) ON DELETE CASCADE , CONSTRAINT [FK_principal_principal21] FOREIGN KEY ( [locales1] ) REFERENCES [principal2] ( [locales1] ) ON DELETE CASCADE ) ON [PRIMARY]
Código:
CREATE TABLE [principal1] ( [foranea1] [char] (10) COLLATE Modern_Spanish_CI_AS NOT NULL , [local1] [char] (10) COLLATE Modern_Spanish_CI_AS NULL , [local2] [char] (10) COLLATE Modern_Spanish_CI_AS NULL , [local3] [char] (10) COLLATE Modern_Spanish_CI_AS NULL , [local4] [char] (10) COLLATE Modern_Spanish_CI_AS NULL , CONSTRAINT [PK_principal1] PRIMARY KEY NONCLUSTERED ( [foranea1] ) ON [PRIMARY] ) ON [PRIMARY] Tabla llamada principal2 con una llave primaria
Código:
CREATE TABLE [principal2] ( [locales1] [char] (10) COLLATE Modern_Spanish_CI_AS NOT NULL , [locales2] [char] (10) COLLATE Modern_Spanish_CI_AS NULL , CONSTRAINT [PK_principal2] PRIMARY KEY NONCLUSTERED ( [locales1] ) ON [PRIMARY] ) ON [PRIMARY]
Ojalà me puedas ayudar
<IMG SRC="images/futbol.gif" WIDTH="15" HEIGHT="15" HSPACE="3"> | <IMG SRC="images/futbol.gif" WIDTH="15" HEIGHT="15" HSPACE="3">
La luz, la piel del mundo