在SQL 2014中限制 [英] Restrict in SQL 2014

查看:157
本文介绍了在SQL 2014中限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加了所有表格。

之后我想添加外键但我的错误是'限制'关键字



i added all my tables.
and after that i wanna to add foreign key but my error is on 'restrict' keyword

alter table ACCESS
   add constraint FK_ACCESS_REFERENCE_USER foreign key (USERID)
      references "USER" (USERID)      
	   on delete restrict
	   on update restrict;



------------------------- -----------------------

文本错误是:消息156,级别15,状态1,行4不正确关键字'restrict'附近的语法。



我尝试过:



i插入我的所有表格....


------------------------------------------------
the texts error is : Msg 156, Level 15, State 1, Line 4Incorrect syntax near the keyword 'restrict'.

What I have tried:

i inserted all my tables and ....

推荐答案

restrict 不是有效的语法



它只有这些选项

restrict is not a valid syntax

It has only these options
ON DELETE { NO ACTION | CASCADE | SET NULL | SET DEFAULT }





根据您的需要替换任何关键字的限制。



更多信息此链接 [ ^ ]


这篇关于在SQL 2014中限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆