Menampilkan semua Foreign Key (FK) pada SQL Server

Query untuk menampilkan atau melihat semua Foreign Key (FK) yang telah kita buat sebelumnya pada Database SQL Server


Untuk menampilkan atau melihat semua Foreign Key (FK) yang telah kita buat sebelumnya pada Database SQL Server dapat menggunakan query berikut ini:

[SELECT RC.CONSTRAINT_NAME FK_Name , KF.TABLE_SCHEMA FK_Schema , KF.TABLE_NAME FK_Table , KF.COLUMN_NAME FK_Column , RC.UNIQUE_CONSTRAINT_NAME PK_Name , KP.TABLE_SCHEMA PK_Schema , KP.TABLE_NAME PK_Table , KP.COLUMN_NAME PK_Column , RC.MATCH_OPTION MatchOption , RC.UPDATE_RULE UpdateRule , RC.DELETE_RULE DeleteRule FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS RC JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE KF ON RC.CONSTRAINT_NAME = KF.CONSTRAINT_NAME JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE KP ON RC.UNIQUE_CONSTRAINT_NAME = KP.CONSTRAINT_NAME]

Query tersebut jika di execute akan menampilkan nama foreign key, nama schema, nama tabel, nama kolom, nama primary key, nama schema primary key, nama tabel primary key, nama kolom primary key, Match Option, Update Rule dan Delete Rule.


Untuk memahami artikel ini sebelumnya anda perlu tahu bagaimana cara membuar foreign key.

COMMENTS

Nama

Apache,4,Bisnis,1,Bisnis Online,1,Blog,10,Blogger,6,Cpanel,1,CSS,1,Database,4,Framework,1,Hacking,3,HTML,1,HTML and CSS,2,Info,2,Javascript,2,Javascript and AJAX,5,Keamanan Web,1,linux,2,Muslim,1,MySQL,12,Networking,1,Open GL,1,Optimasi Website,7,Pemrograman java,1,Pemrograman web,7,PHP,9,phpMyAdmin,2,PosgreSql,7,SEO,4,SQL,11,SQL Injection,3,SQL Server,19,SQLMap,3,UMKM,2,Umroh,1,Website,1,Wordpress,4,Xampp,1,
ltr
item
Nanang Gunawan Blog: Menampilkan semua Foreign Key (FK) pada SQL Server
Menampilkan semua Foreign Key (FK) pada SQL Server
Query untuk menampilkan atau melihat semua Foreign Key (FK) yang telah kita buat sebelumnya pada Database SQL Server
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqW3_maSJEAMALCoSLUcxoUTOKNKif-tY4PZtqpkUYivyjmSfaaM2sDXYAyUxDmYnH5badIKxPqaGiTF9AX3V0lNzS-djhxTSezANUdu-3he5wAN9THknpPPlb6eQDswW4XZBFtpguQy8/s1600/Foreign+Key-min.jpg
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqW3_maSJEAMALCoSLUcxoUTOKNKif-tY4PZtqpkUYivyjmSfaaM2sDXYAyUxDmYnH5badIKxPqaGiTF9AX3V0lNzS-djhxTSezANUdu-3he5wAN9THknpPPlb6eQDswW4XZBFtpguQy8/s72-c/Foreign+Key-min.jpg
Nanang Gunawan Blog
https://www.nananggunawan.com/2017/06/menampilkan-semua-foreign-key-sql-server.html
https://www.nananggunawan.com/
https://www.nananggunawan.com/
https://www.nananggunawan.com/2017/06/menampilkan-semua-foreign-key-sql-server.html
true
4195327445586723627
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content