DB - Id: IS NOT Null
DB - Id: IS NOT Null
USE master
GO
/* MODULO: Mantenimiento
Crear Tablas
Crear Primary Key
Crear Foreign Kye
Crear Diagrama ER */
USE bdDELIVPOST
GO
USE bdDELIVPOST
GO
/* Relacion Mantto_Proveedores */
ALTER TABLE Mantto
WITH CHECK ADD CONSTRAINT FK_Mantto_Proveedores
FOREIGN KEY (IdProveedor)
REFERENCES Proveedores (IdProveedor)
/* Relacion Mantto_Motos */
ALTER TABLE Mantto
WITH CHECK ADD CONSTRAINT FK_Mantto_Motos
FOREIGN KEY (IdMoto)
REFERENCES Motos (IdMoto)
/* Relacion ManttoDetalle_Mantto */
ALTER TABLE ManttoDetalle
WITH CHECK ADD CONSTRAINT FK_ManttoDetalle_Mantto
FOREIGN KEY (IdMantto)
REFERENCES Mantto (IdMantto)
/* Relacion ManttoRepuestos_Mantto */
ALTER TABLE ManttoRepuestos
WITH CHECK ADD CONSTRAINT FK_ManttoRepuestos_Mantto
FOREIGN KEY (IdMantto)
REFERENCES Mantto (IdMantto)
/* Relacion ManttoRepuestos_Repuestos */
ALTER TABLE ManttoRepuestos
WITH CHECK ADD CONSTRAINT FK_ManttoRepuestos_Repuestos
FOREIGN KEY (IdRepuesto)
REFERENCES Repuestos (IdRepuesto)
USE bdDELIVPOST
GO