Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS

  No additional text.


Syntax
CREATE VIEW INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS
AS
SELECT
	DB_NAME()				AS CONSTRAINT_CATALOG,
	SCHEMA_NAME(f.schema_id)		AS CONSTRAINT_SCHEMA,
	f.name					AS CONSTRAINT_NAME,
	DB_NAME()				AS UNIQUE_CONSTRAINT_CATALOG,
	SCHEMA_NAME(t.schema_id)		AS UNIQUE_CONSTRAINT_SCHEMA,
	i.name					AS UNIQUE_CONSTRAINT_NAME,
	convert(varchar(7), 'SIMPLE')	AS MATCH_OPTION,
	convert(varchar(11), CASE f.update_referential_action
		WHEN 0 THEN 'NO ACTION'
		WHEN 1 THEN 'CASCADE'
		WHEN 2 THEN 'SET NULL'
		WHEN 3 THEN 'SET DEFAULT' END) AS UPDATE_RULE,
	convert(varchar(11), CASE f.delete_referential_action
		WHEN 0 THEN 'NO ACTION'
		WHEN 1 THEN 'CASCADE'
		WHEN 2 THEN 'SET NULL'
		WHEN 3 THEN 'SET DEFAULT' END) AS DELETE_RULE
FROM		
	sys.foreign_keys f
	LEFT JOIN sys.indexes i ON i.object_id = f.referenced_object_id AND i.index_id = f.key_index_id
	LEFT JOIN sys.tables t ON t.object_id = f.referenced_object_id

 
Last revision 2008RTM
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