Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 SQL scripting response error

Author  Topic 

sparkyd113
Starting Member

1 Post

Posted - 2010-04-15 : 13:22:18
CREATE TABLE COMPUTER_ASSIGNMENT(
SerialNumber Int not null,
EmployeeNumber Int not null,
DateAssigned DateTime null,
CONSTRAINT SerialNumber_PK PRIMARY KEY (SerialNumber),
CONSTRAINT EmployeeNumber_FK FOREIGN KEY (EmployeeNumber)
REFERENCES EMPLOYEE (EmployeeNumber)
ON UPDATE NO ACTION,
REFERENCES COMPUTER (SerialNumber)
ON UPDATE NO ACTION
ON DELETE CASCADE
);

When I execute this script I get an error,
Msg 142, Level 15, State 2, Line 0
Incorrect syntax for definition of the 'TABLE' constraint.
Any help would be appriciated, I've tried rearanging the references but when I do that I get an incorrect syntax at REFERENCES
   

- Advertisement -