View Single Post
Old 11-30-2012, 03:54 AM   PM User | #1
hiya1992
New to the CF scene

 
Join Date: Nov 2012
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
hiya1992 is an unknown quantity at this point
MySQL syntax help

Hiya all, i keep getting a
"Token line error=7, Token line offset=1, Token in error=CONSTRAINT" error message.

Using this code
Code:
Create Table Orders(
orderNumber bigint Not Null,
orderDate datetime Not Null,
completed bit Not Null,
discount numeric(2,1),
PRIMARY KEY(orderNumber)
CONSTRAINT FK_Orders_Store
FOREIGN KEY(StoreID) REFERENCES Store(StoreID)
CONSTRAINT FK_Orders_Pizza
FOREIGN KEY(itemCode) REFERENCES Pizza(itemCode)
)
(the below codes are seperate tables)

Code:
Create Table Store(
StoreID int IDENTITY,
town nvarchar(25) NOT NULL,
address nvarchar(50) NOT NULL,
PRIMARY KEY(StoreID)
)
Code:
Create Table Pizza(
itemCode int IDENTITY, 
pizzaName nvarchar(25) NOT NULL,
baseType nvarchar(20) NOT NULL,
PRIMARY KEY(itemCode)
)
Any help?

Last edited by hiya1992; 11-30-2012 at 06:40 PM..
hiya1992 is offline   Reply With Quote