Foreign Key Syntax in SQL The syntax of the SQLFOREIGN KEYconstraint is: CREATETABLEtable_name ( column1 data_type, column2 data_type, ...,FOREIGNKEY(column_name)REFERENCESreferenced_table_name (referenced_colum
SQLForeignKeys以标准结果集的形式返回结果。 如果请求与主键关联的外键,则按FKTABLE_CAT、FKTABLE_SCHEM、FKTABLE_NAME和KEY_SEQ对结果集进行排序。 如果请求与外键关联的主键,则按PKTABLE_CAT、PKTABLE_SCHEM、PKTABLE_NAME和KEY_SEQ对结果集进行排序。 下表列出了结果集中的列。
syntaxsql 복사 sp_foreignkeys [ @table_server = ] N'table_server' [ , [ @pktab_name = ] N'pktab_name' ] [ , [ @pktab_schema = ] N'pktab_schema' ] [ , [ @pktab_catalog = ] N'pktab_catalog' ] [ , [ @fktab_name = ] N'fktab_name' ] [ , [ @fk...
insert into busi_table values("1001","gx", "11"); //failed,提示: ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`smb_man`.`busi_table`, CONSTRAINT `busi_table_ibfk_1` FOREIGN KEY (`repo_id`) REFERENCES `repo_table` (`repo_id`)) 3)增...
http://dev.mysql.com/doc/refman/5.5/en/innodb-foreign-key-constraints.html 中文网站 http://dev.mysql.com/doc/refman/5.1/zh/sql-syntax.html 【5】 对外键讲解的比较全面,可以一读 http://www.xiaoxiaozi.com/2009/07/12/1158/ ...
Transact-SQL Syntax Conventions Syntax sp_foreignkeys [ @table_server = ] 'table_server' [ , [ @pktab_name = ] 'pktab_name' ] [ , [ @pktab_schema = ] 'pktab_schema' ] [ , [ @pktab_catalog = ] 'pktab_catalog' ] [ , [ @fktab_name = ] 'fktab_name' ] [ , [ @fk...
SQL Server / Oracle / MS Access: CREATETABLEOrders ( OrderID intNOTNULLPRIMARYKEY, OrderNumber intNOTNULL, PersonID intFOREIGNKEYREFERENCESPersons(PersonID) ); To allow naming of aFOREIGN KEYconstraint, and for defining aFOREIGN KEYconstraint on multiple columns, use the following SQL syntax: ...
PostgreSQL foreign key constraint syntax The following illustrates a foreign key constraint syntax: [CONSTRAINT fk_name] FOREIGN KEY(fk_columns) REFERENCES parent_table(parent_key_columns) [ON DELETE delete_action] [ON UPDATE update_action] In this syntax: First, specify the name for the foreign...
9.1.4.1 Adding Foreign Key Relationships Using an EER Diagram 9.1.4.2 The Relationship Editor 9.1.4.3 Connection PropertiesForeign key constraints are supported for the InnoDB storage engine only. For other storage engines, the foreign key syntax is correctly parsed but not implemented. For more info...
【4】mysql官网英文网站 http://dev.mysql.com/doc/refman/5.5/en/innodb-foreign-key-constraints.html 中文网站 http://dev.mysql.com/doc/refman/5.1/zh/sql-syntax.html 【5】 对外键讲解的比较全面,可以一读 http://www.xiaoxiaozi.com/2009/07/12/1158/...