This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE IF EXISTS CTE_AllTables; | |
-- CREATE TEMPORARY TABLE IF NOT EXISTS CTE_AllTables | |
CREATE TEMPORARY TABLE CTE_AllTables AS | |
SELECT | |
ist.table_schema AS OnTableSchema | |
,ist.table_name AS OnTableName | |
,tForeignKeyInformation.FkNullable | |
-- WARNING: TableSchema or Tablename can contain entry-separator (';' used) | |
,CAST(DENSE_RANK() OVER (ORDER BY ist.table_schema, ist.table_name) AS varchar(20)) AS OnTableId |