Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.foreign_keys

  No additional text.


Syntax
CREATE VIEW sys.foreign_keys AS
	SELECT o.name, o.object_id, o.principal_id, o.schema_id, o.parent_object_id,
		o.type, o.type_desc, o.create_date, o.modify_date,
		o.is_ms_shipped, o.is_published, o.is_schema_published,
		f.indepid AS referenced_object_id,
		f.indepsubid AS key_index_id,
		o.is_disabled, o.is_not_for_replication, o.is_not_trusted,
		o.delete_referential_action,	-- ERefAct
		d.name AS delete_referential_action_desc,
		o.update_referential_action,	-- ERefAct
		u.name AS update_referential_action_desc,
		o.is_system_named
	FROM sys.objects$ o
	LEFT JOIN sys.syssingleobjrefs f ON f.depid = o.object_id AND f.class = 27 AND f.depsubid = 0	-- SRC_FK_REFD_INDEX
	LEFT JOIN sys.syspalvalues d ON d.class = 'FKRA' AND d.value = o.delete_referential_action
	LEFT JOIN sys.syspalvalues u ON u.class = 'FKRA' AND u.value = o.update_referential_action
	WHERE o.type = 'F '

 
Last revision 2008RTM
See also

  KEY_COLUMN_USAGE (View)
REFERENTIAL_CONSTRAINTS (View)
sp_addmergefilter (Procedure)
sp_changemergefilter (Procedure)
sp_fkeys (Procedure)
sp_foreignkeys (Procedure)
sp_foreign_keys_rowset (Procedure)
sp_foreign_keys_rowset2 (Procedure)
sp_foreign_keys_rowset3 (Procedure)
sp_foreign_keys_rowset_rmt (Procedure)
sp_generatefilters (Procedure)
sp_help (Procedure)
sp_helpconstraint (Procedure)
sp_MSaddupdatetrigger (Procedure)
sp_MScheck_join_filters (Procedure)
sp_MSdropconstraints (Procedure)
sp_MSdropfkreferencingarticle (Procedure)
sp_MSenumpubreferences (Procedure)
sp_MSfixup_constraints_name (Procedure)
sp_MSfixup_single_ddls (Procedure)
sp_MShelpmergearticles_nonpartgroups (Procedure)
sp_MSis_joinfilter_based_on_PK_UQ_constraints (Procedure)
sp_MSmakeorcheck_joinfilter_using_dri (Procedure)
sp_MSmergefixup_constraints_name (Procedure)
sp_MSmerge_altertable (Procedure)
sp_MSNonSQLDDL (Procedure)
sp_MSrefcnt (Procedure)
sp_MSrepl_getpkfkrelation (Procedure)
sp_MSrepl_setNFR (Procedure)
sp_MSscript_dri (Procedure)
sp_MStablerefs (Procedure)
sp_repladdcolumn (Procedure)
sysreferences (View)
       



News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash