SYS.FOREIGN_KEYS
Description
Column name
Data type
Description
Has equivalent column in Snowflake
Column name
Data type
Description
Has equivalent column in Snowflake
Applicable column equivalence
SQLServer
Snowflake
Limitations
Applicable
Syntax in SQL Server
Syntax in Snowflake
Sample Source Patterns
1. Simple Select Case
SQL Server
name
object_id
principal_id
schema_id
type
type_desc
create_date
modify_date
parent_object_id
is_ms_shipped
is_published
is_schema_published
referenced_object_id
key_index_id
is_disabled
is_not_for_replication
is_not_trusted
delete_referential_action
delete_referential_action_desc
update_referential_action
update_referential_action_desc
is_system_named
Snowflake
CONSTRAINT_CATALOG
CONSTRAINT_SCHEMA
CONSTRAINT_NAME
TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME
CONSTRAINT_TYPE
IS_DEFERRABLE
INITIALLY_DEFERRED
ENFORCED
COMMENT
CREATED
LAST_ALTERED
RELY
2. Name Column Case
SQL Server
name
object_id
principal_id
schema_id
type
type_desc
create_date
modify_date
parent_object_id
is_ms_shipped
is_published
is_schema_published
referenced_object_id
key_index_id
is_disabled
is_not_for_replication
is_not_trusted
delete_referential_action
delete_referential_action_desc
update_referential_action
update_referential_action_desc
is_system_named
Snowflake
CONSTRAINT_CATALOG
CONSTRAINT_SCHEMA
CONSTRAINT_NAME
TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME
CONSTRAINT_TYPE
IS_DEFERRABLE
INITIALLY_DEFERRED
ENFORCED
COMMENT
CREATED
LAST_ALTERED
RELY
3. Parent Object ID Case
SQL Server
name
object_id
principal_id
schema_id
type
type_desc
create_date
modify_date
parent_object_id
is_ms_shipped
is_published
is_schema_published
referenced_object_id
key_index_id
is_disabled
is_not_for_replication
is_not_trusted
delete_referential_action
delete_referential_action_desc
update_referential_action
update_referential_action_desc
is_system_named
Snowflake
CONSTRAINT_CATALOG
CONSTRAINT_SCHEMA
CONSTRAINT_NAME
TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME
CONSTRAINT_TYPE
IS_DEFERRABLE
INITIALLY_DEFERRED
ENFORCED
COMMENT
CREATED
LAST_ALTERED
RELY
4. Type Column Case
SQL Server
name
object_id
principal_id
schema_id
type
type_desc
create_date
modify_date
parent_object_id
is_ms_shipped
is_published
is_schema_published
referenced_object_id
key_index_id
is_disabled
is_not_for_replication
is_not_trusted
delete_referential_action
delete_referential_action_desc
update_referential_action
update_referential_action_desc
is_system_named
Snowflake
CONSTRAINT_CATALOG
CONSTRAINT_SCHEMA
CONSTRAINT_NAME
TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME
CONSTRAINT_TYPE
IS_DEFERRABLE
INITIALLY_DEFERRED
ENFORCED
COMMENT
CREATED
LAST_ALTERED
RELY
5. Type Desc Column Case
SQL Server
name
object_id
principal_id
schema_id
type
type_desc
create_date
modify_date
parent_object_id
is_ms_shipped
is_published
is_schema_published
referenced_object_id
key_index_id
is_disabled
is_not_for_replication
is_not_trusted
delete_referential_action
delete_referential_action_desc
update_referential_action
update_referential_action_desc
is_system_named
Snowflake
CONSTRAINT_CATALOG
CONSTRAINT_SCHEMA
CONSTRAINT_NAME
TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME
CONSTRAINT_TYPE
IS_DEFERRABLE
INITIALLY_DEFERRED
ENFORCED
COMMENT
CREATED
LAST_ALTERED
RELY
6. Modify Date Column Simple Case
SQL Server
Snowflake
7. Modify Date Column with DATEDIFF() Case
SQL Server
Snowflake
8. Create Date Column Case
SQL Server
Snowflake
9. Selected Columns Single Name Case
SQL Server
name
Snowflake
CONSTRAINT_NAME
10. Selected Columns Qualified Name Case
SQL Server
name
Snowflake
CONSTRAINT_NAME
Known Issues
1. The 'name' column may not show a correct output if the constraint does not have a user-created name
2. When selecting columns, there is a limitation that depends on the applicable columns that are equivalent in Snowflake
3. The OBJECT_ID() function may have a valid pattern to be processed or the database, schema or table could not be extracted
4. Name Column With OBJECT_NAME() Function Case
5. SCHEMA_NAME() and TYPE_NAME() functions are also not supported yet.
6. Different Join statement types may be not supported if the system table is not supported. Review the supported system tables here.
7. Cases with JOIN statements are not supported.
8. Names with alias AS are not supported.
Related EWIs
Last updated
Was this helpful?