how to fix Object reference not set to an instance of an object. (SqlMgmt)

Ravi Dba 0 Reputation points
2023-07-18T10:42:57.9766667+00:00

Object reference not set to an instance of an object. (SqlMgmt)

------------------------------
Program Location:

   at Microsoft.SqlServer.Management.SqlMgmt.PermissionsData.Securable.GetImage(SecurableType type)
   at Microsoft.SqlServer.Management.SqlMgmt.PermissionsSecurableSelector.InitializeBitmaps()
   at Microsoft.SqlServer.Management.SqlMgmt.PermissionsSecurableSelector..ctor(IHelpProvider helpProvider, IServiceProvider serviceProvider, Principal principal, PermissionsDetailsGrid permissionsGrid, Object connectionInfo, Boolean yukonOrGreater)
   at Microsoft.SqlServer.Management.SqlMgmt.PermissionsOfPrincipalsCore.InitializeSecurableSelector()
   at Microsoft.SqlServer.Management.SqlMgmt.PermissionsOfPrincipalsCore..ctor(IHelpProvider helpProvider, IServiceProvider serviceProvider, Principal principal, Object connectionInfo, Boolean yukonOrGreater, Boolean showColumnPermissionsInDetailsGrid)
   at Microsoft.SqlServer.Management.SqlMgmt.PermissionsDatabasePrincipal.InitializePermissionsCore()
   at Microsoft.SqlServer.Management.SqlMgmt.PermissionsDatabasePrincipal.OnInitialization()
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SetView(Int32 index, TreeNode node)
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SelectCurrentNode()
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.InitializeUI(ViewSwitcherTreeView treeView, ISqlControlCollection viewsHolder, Panel rightPane)
   at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm.InitializeForm(XmlDocument doc, IServiceProvider provider, ISqlControlCollection control)
   at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm..ctor(XmlDocument doc, IServiceProvider provider)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolMenuItemHelper.OnCreateAndShowForm(IServiceProvider sp, XmlDocument doc)
   at Microsoft.SqlServer.Management.SqlMgmt.RunningFormsTable.RunningFormsTableImpl.ThreadStarter.StartThread()


SQL Server Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2023-07-18T11:27:36.7666667+00:00

    First, this is a very generic.NET error, so without any context it is impossible to comment.

    But whatever, you should never see this error. Basically, it is a bug in SSMS, although it could be that something is a bit corrupted in your machine.

    In any case, if you are not running version 19.1, which is the most recent version of SSMS, download and install it.

    If the problem persists after this, please share the steps you are doing when you get this error.

    Note that if you have an older version of SSMS install (that is SSMS 18 or earlier), SSMS 19 will install in parallel with your old SSMS installation..


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.