me encuentro haciendo una tabla y me tira este error : Foreign Key references FK_Orders_codigoHash references invalid table customers, a que se debe?
CREATE TABLE orders(
ordersID int NOT NULL,/*HEREDA*/
OrderTotal smallint NOT NULL,
OrderStatusID int NOT NULL,/*HEREDA*/
OrderDate smalldatetime NOT NULL,
PRIMARY KEY(ordersID),
customerID int REFERENCES customers(customerID)
)
La tabla de la cual quiero hacer la relacion es:
CREATE TABLE customers(
customerID int NOT NULL,
phoneNumber char(10) NOT NULL,
[name] nvarchar(100) NOT NULL,
adress nvarchar(100) NOT NULL,
city nvarchar(50) NOT NULL,
state char(2),
PRIMARY KEY(customerID)
9
9
en lugar del paréntesis final de la creación decustomers
, no será que no existecustomers
cuando intentas crearorders
?