From 74457f475a206d6da2e92a437a96a6a0f0358f5b Mon Sep 17 00:00:00 2001 From: Alex Klein Date: Sat, 6 Jul 2024 15:59:11 +0200 Subject: [PATCH] fix(mssql): IDENTITY columns not detected outside default schema Fixes dimitri/pgloader#1586 Co-Authored-By: Nathanael Ruf --- src/sources/mssql/sql/list-all-columns.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sources/mssql/sql/list-all-columns.sql b/src/sources/mssql/sql/list-all-columns.sql index 94b15608..bda1791a 100644 --- a/src/sources/mssql/sql/list-all-columns.sql +++ b/src/sources/mssql/sql/list-all-columns.sql @@ -30,7 +30,7 @@ ELSE c.COLUMN_DEFAULT END, c.IS_NULLABLE, - COLUMNPROPERTY(object_id(c.TABLE_NAME), c.COLUMN_NAME, 'IsIdentity'), + COLUMNPROPERTY(OBJECT_ID(c.TABLE_SCHEMA + '.' + c.TABLE_NAME), c.COLUMN_NAME, 'IsIdentity'), c.CHARACTER_MAXIMUM_LENGTH, c.NUMERIC_PRECISION, c.NUMERIC_PRECISION_RADIX,