SQL Server Compact Edition 3.5中的外键问题

时间:2011-08-26 14:19:36

标签: sql-server-ce

我是SQL Server CE的新手。

当我尝试创建具有外键和主键关系的表时,我收到错误。 能不能让我知道我的代码有什么问题。

CREATE TABLE ACTIVECALLS
    (CallID int PRIMARY KEY,
     EPName nvarchar PRIMARY KEY,
     ConsoleName nvarchar,
     DispatcherName nvarchar,
     EmergencyCall bit,
     CallDirectionId tinyint foreign key references CallDirection(CallDirectionId), 
     CallStateId tinyint foreign key references CallState(CallStateId)
    );

1 个答案:

答案 0 :(得分:0)

CREATE TABLE  ACTIVECALLS(

CallID int PRIMARY KEY,
EPName nvarchar(50) PRIMARY KEY,
ConsoleName nvarchar(50,
DispatcherName nvarchar(50),
EmergencyCall bit,
CallDirectionId tinyint references CallDirection(CallDirectionId ), 
CallStateId tinyint references CallState(CallStateId));