akarzazi / SSMSPlus

SSMS Plus is a productivity extension for SQL Server Management Studio 18 /19
76 stars 22 forks source link

Error schema search #15

Closed matteoventuri7 closed 3 years ago

matteoventuri7 commented 3 years ago

SSMSPlus version: 3.2 SSMS version: 18.9.1

ERROR: System. Collections.Generic.KeyNotFoundException in System.Collections.Generic.Dictionary'2.getltem(TKey key) in SSMSPIusSearch.Repositories.SchemaSearchRepository.MapDbObjectParents(Dictionary'2 dbobjecstBylD) in D:\github\SSMSPIus\src\SSMSPIusSearch\Repositories\SchemaSearchRepository.' in SSMSPIusSearch.Repositories.SchemaSearchRepository.d_5.MoveNextO in D:\github\SSMSPIus\src\SSMSPIusSearch\Repositories\SchemaSearchRepository.cs:riga 93 — Fine traccia dello stack da posizione precedente dove e stata generata I’eccezione — in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in SSMSPIusSearch.UI.SchemaSearchControlVM.d_49.MoveNextO in D:\github\SSMSPIus\src\SSMSPIusSearch\UI\SchemaSearchControlVM.cs:riga 158 — Fine traccia dello stack da posizione precedente dove e stata generata I’eccezione — in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in SSMSPIusSearch.UI.SchemaSearchControlVM.d_46.MoveNextO in D:\github\SSMSPIus\src\SSMSPIusSearch\UI\SchemaSearchControlVM.cs:riga 128 — Fine traccia dello stack da posizione precedente dove e stata generata I’eccezione — in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in SSMSPIusCore.Utils.SafeTask.d_1.MoveNextO in D:\github\SSMSPIus\src\SSMSPIusCore\Utils\SafeTask.cs:riga 30

rikin-patel435 commented 3 years ago

Hi @matteoventuri7

Can you please provide some steps and more info on when you will get this kind of error? Have you any kind of observation then please mention those things also.

matteoventuri7 commented 3 years ago

I notice i installed SSMS Lizard and it return error like this. So i think cause maybe is database. Database is a very old database. I cannot share it with you.

akarzazi commented 3 years ago

What are the sql server version and database compatibility model ?

Can you please provide the results of the following query on your db ?

select * FROM sys.objects AS o WHERE o.is_ms_shipped = 0 and o.parent_object_id <> 0 and o.parent_object_id not in ( select object_id FROM sys.objects AS o WHERE o.is_ms_shipped = 0)

matteoventuri7 commented 3 years ago

This this output in CSV format:

"name" "object_id" "principal_id" "schema_id" "parent_object_id" "type" "type_desc" "create_date" "modify_date" "is_ms_shipped" "is_published" "is_schema_published" "pk_dtproperties" "1010102639" \N "1" "994102582" "PK" "PRIMARY_KEY_CONSTRAINT" "2006-04-03 12:00:55,653" "2006-04-03 12:00:55,653" "False" "False" "False" "DFdtpropertversi__3D2915A8" "1026102696" \N "1" "994102582" "D " "DEFAULT_CONSTRAINT" "2006-04-03 12:00:55,653" "2006-04-03 12:00:55,653" "False" "False" "False"

akarzazi commented 3 years ago

It seems the database contains objects that are either orphaned or have is_ms_shipped parents.

I've fixed the issue in a new release https://github.com/akarzazi/SSMSPlus/releases/tag/4.0

You will need to click on the reindex button on the top right of SchemaSearch windows, to refresh the database metadata.

matteoventuri7 commented 3 years ago

Fixed! Thanks!