消息 102,级别 15,状态 1,第 7 行 ')' 附近有语法错误。

windream1991 2012-04-04 10:08:58
/*==============================================================*/
/* Table: Friend */
/*==============================================================*/
create table Friend (
Host_ID ID not null,
Friend_ID ID not null,
Friend_Catagory smallint not null,
Remark_Name Online_Name not null,
constraint PK_FRIEND primary key nonclustered (Host_ID, Friend_ID)
)
go

/*==============================================================*/
/* Index: Relationship_17_PK */
/*==============================================================*/
create unique clustered index Relationship_17_PK on Friend (

)
go

/*==============================================================*/
/* Index: Relationship_20_FK */
/*==============================================================*/
create index Relationship_20_FK on Friend (
Host_ID ASC
)
go

/*==============================================================*/
/* Index: Relationship_21_FK */
/*==============================================================*/
create index Relationship_21_FK on Friend (
Friend_ID ASC
)
go

alter table Friend
add constraint "FK_FRIEND_FRIEND->U_USERS" foreign key (Friend_ID)
references Users (User_ID)
go

alter table Friend
add constraint "FK_FRIEND_FRIEND->U_USERS" foreign key (Host_ID)
references Users (User_ID)
go


建好友表的时候出来的问题……
改了一天都不知道怎么回事……求救啊!!!!!
...全文
665 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
shuohuameijiang 2012-04-05
  • 打赏
  • 举报
回复


create table Friend (
Host_ID int not null,
Friend_ID int not null,
Friend_Catagory smallint not null,
Remark_Name Online_Name not null,
constraint PK_FRIEND primary key nonclustered (Host_ID, Friend_ID)
)
go

  • 打赏
  • 举报
回复
Host_ID ID not null,
Friend_ID ID not null,

Remark_Name Online_Name not null,
数据类型不对
  • 打赏
  • 举报
回复
Host_ID ID not null,
Friend_ID ID not null,

Remark_Name Online_Name not null,
缺少数据类型
  • 打赏
  • 举报
回复
可能是中文符号惹的祸,看是不是有中文的空格了

22,206

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧