嘗試在SSMS 2012中打開SQL文本編輯器時出現奇怪的錯誤。錯誤引發任何選項,如新建查詢,修改存儲過程,選擇前1000行,任何打開腳本編輯器的操作。當我進入工具/選項/文本編輯器/ [任何語言]程序中斷並顯示Windows錯誤。嘗試打開SQL文本編輯器時發生SQL Server 2012 Management Studio錯誤
這是奇怪的錯誤。我複製了錯誤細節,但對我來說沒有任何意義。
===================================
發生內部錯誤。附加信息: ''。 (mscorlib程序)
------------------------------項目地點:
在 System.ComponentModel。 Composition.Hosting.ImportEngine.InPrerequisiteLoop() 在 System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportsStateMachine(partManager partManager,ComposablePart部分)在 System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImports(partManager partManager,ComposablePart部分,布爾shouldTrackImports)在 System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImports(ComposablePart 部分)在 System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine 發動機,ComposablePart部分,ExportDefinition定義)在 System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue(CatalogPart 部分,ExportDefinition出口,布爾isSharedPart )在 System.ComponentModel.Composition.Hosting.CatalogExportProvider.CatalogExport.GetExportedValueCore() 在System.ComponentModel.Composition.Primitives.Export.get_Value()
在 System.ComponentModel.Composition.ExportServices.GetCastedExportedValue [T](導出 導出)在 System.ComponentModel.Composition.Hosting.ExportP rovider.GetExportedValueCore [T](字符串 contractName,ImportCardinality基數)在 System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValue [T](字符串 contractName)在 System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValueT 在 Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetServiceT 處 微軟 Microsoft.VisualStudio.Editor.Implementation.VsDocDataAdapter.SetSite(對象 pUnkSite)在 Microsoft.VisualStudio.Editor.Implementation.VsTextBufferAdapter.SetSite(對象 pUnkSite) .SqlServer.Management.UI.VSIntegration.ShellTextBuffer.SetSite(Object 的ServiceProvider)處 Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptEditorControl.Initialize(對象 SP) Microsoft.SqlServer.Management.UI.VSIntegration.ShellTextEditorControl.CreateAndInitTextBuffer(對象 SP)在 Microsoft.SqlServer .Management.UI.VSIntegration.Editors.ScriptAndResultsEditorControl.Initialize(Object sp)at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.SqlScriptEditorControl。在初始化時 Microsoft.SqlServer.Management.UI.VSIntegration.Editors Microsoft.SqlServer.Management.UI.VSIntegration.Editors.SqlScriptEditorControl.CreateInstance(對象 的ServiceProvider,布爾withEncoding,字符串的綽號)(對象 SP,字符串的綽號) .EditorFactorySql.CreateEditorInstance(的IServiceProvider 的ServiceProvider,布爾storeActiveConnIfNeeded,字符串綽號)
在 Microsoft.SqlServer.Management.UI.VSIntegration.Editors.EditorFactoryBase.Microsoft.VisualStudio.Shell.Interop.IVsEditorFactory.CreateEditorInstance(UInt32的 createFlags,字符串名字,String physicalView,IVsHierarchy 層次結構,UInt32 itemId,IntPtr existingDocData,IntPtr & docViewIntPtr,IntPtr的& docDataIntPtr,字符串&字幕,的Guid & cmdUIGuid,的Int32 &結果)在 System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(的Int32 的errorCode,IntPtr的errorInfo中)在 Microsoft.SqlServer.Management.UI。 VSIntegration.Editors.ScriptFactory.CreateNewScript(字符串 strFullPathToScript,IVsProject projectToAddScriptTo, UIConnectionGroupInfo connectionInfoList,的IDbConnection liveCon, 字符串ROOTNAME)在 Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptFactory.CreateNewScript(字符串 strFullPathToScript,IVsEx ternalFilesManager extFileMgr, UIConnectionGroupInfo connectionInfoList,的IDbConnection liveCon, 字符串ROOTNAME)維持在 微軟 Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptFactory.CreateNewScript(字符串 strFullPathToScript,UIConnectionGroupInfo connectionInfoList, 的IDbConnection liveCon,字符串fileRoot)。 SqlServer.Management.UI.VSIntegration.Editors.ScriptFactory.CreateNewScript(字符串 strFullPathToScript,UIConnectionInfo Cl,的IDbConnection liveCon)在 Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NewQueryMenuHandler.Invoke() 在 Microsoft.SqlServer。 Management.UI.VSIntegration.ObjectExplorer.ToolsMenuItemBase.MenuInvokedHandler(Object sender,EventArgs args)
我試圖修復SSMS,但我不知道我在哪裏可以做到這一點。 我無法找到的Microsoft SQL Server Management Studio中的 「程序和功能」
我執行chkdsk並有我的SSD驅動器
Windows已經掃描的文件系統上沒有壞道並沒有發現問題。不需要進一步操作 。
131449855 KB總磁盤空間。 54907808 KB在218559個文件中。 137392KB在61261個索引中。 0 KB的壞道。 392375 KB由系統使用。 65536 KB由日誌文件佔用。 76012280 KB可用於磁盤。
4096 bytes in each allocation unit. 32862463 total allocation units on disk. 19003070 allocation units available on disk.
當您通過控制面板_uninstall_ SSMS進行修復操作時,儘管完全卸載/重新安裝可能是一個更好的主意,但要確保不會將文件複製回潛在的問題本地磁盤上的扇區。 [這裏是](https://www.techwalla.com/articles/how-to-repair-sql-server-management-studio)一篇文章,將指導你完成整個過程。 –
@JohnEisbrener我有Windows 10,而SQL Server Management Studio不是「程序和功能」中的已安裝程序。 –
我將我對下面答案的回覆提出來了,所以我可以添加屏幕截圖。 –