Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 14 paź 2008 · select concat(table_name, '.', column_name) as 'foreign key', concat(referenced_table_name, '.', referenced_column_name) as 'references', constraint_name as 'constraint name' from information_schema.key_column_usage where referenced_table_name is not null;

  2. 20 lip 2009 · You can do this via the information_schema tables. For example: SELECT tc.table_schema, tc.constraint_name, tc.table_name, kcu.column_name, ccu.table_schema AS foreign_table_schema, ccu.table_name AS foreign_table_name, ccu.column_name AS foreign_column_name FROM information_schema.table_constraints AS tc JOIN information_schema.key_column ...

  3. You can add a foreign key constraint to an existing table using the following ALTER TABLE syntax: ALTER TABLE tbl_name ADD [CONSTRAINT [symbol]] FOREIGN KEY [index_name] (col_name, ...) REFERENCES tbl_name (col_name,...) [ON DELETE reference_option] [ON UPDATE reference_option]

  4. 19 sie 2024 · The sp_fkeys stored procedure is a system-defined stored procedure in SQL Server. It returns information about foreign keys in a specific table or a set of related tables. Furthermore, it’s one of the quickest ways to retrieve foreign key information.

  5. 24 maj 2015 · Firstly, find out your FOREIGN KEY constraint name in this way: SELECT TABLE_NAME, COLUMN_NAME, CONSTRAINT_NAME, -- <<-- the one you want! REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_NAME = 'My_Table';

  6. To allow naming of a FOREIGN KEY constraint, and for defining a FOREIGN KEY constraint on multiple columns, use the following SQL syntax: MySQL / SQL Server / Oracle / MS Access: CREATE TABLE Orders ( OrderID int NOT NULL, OrderNumber int NOT NULL, PersonID int, PRIMARY KEY (OrderID), CONSTRAINT FK_PersonOrder FOREIGN KEY (PersonID)

  7. In MySQL, InnoDB tables support checking of foreign key constraints. See Chapter 15, The InnoDB Storage Engine, and Section 1.7.2.3, “FOREIGN KEY Constraint Differences”. A foreign key constraint is not required merely to join two tables. For storage engines other than InnoDB, it is possible when defining a column to use a REFERENCES.

  1. Ludzie szukają również