From 2ed896dd47931bf4b7d03053311c8aff648d8f86 Mon Sep 17 00:00:00 2001 From: ykobuk Date: Tue, 21 Mar 2023 18:41:26 +0200 Subject: [PATCH] Add condition to get mark of primary key if it exists. --- odd_collector_azure/adapters/azure_sql/repository.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/odd_collector_azure/adapters/azure_sql/repository.py b/odd_collector_azure/adapters/azure_sql/repository.py index 2852d11..5cb3637 100644 --- a/odd_collector_azure/adapters/azure_sql/repository.py +++ b/odd_collector_azure/adapters/azure_sql/repository.py @@ -49,7 +49,8 @@ left join INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE t on c.table_name = t.table_name and - c.column_name = t.column_name + c.column_name = t.column_name and + t.constraint_name like 'PK%' where c.table_schema <> 'sys' and c.table_name = '{table_name}' """