2013-05-31 116 views
1

我有一個SQL服務器數據庫,我最近通過SSMS重命名。 數據庫整體工作良好,除了我不能再訪問數據庫圖或創建新數據庫。每當我試圖這樣做,我收到以下錯誤消息 -更改數據庫名後無法訪問數據庫圖

Attempted to read or write protected memory. This is often an indication that other memory is corrupt. 

我怎樣才能重新訪問數據庫圖表,或者至少是,清除它們,並能再次創造新的?

編輯:我剛纔注意到,數據庫圖不能在SQL服務器中的任何數據庫中訪問,而不僅僅是重命名的數據庫。

在SQL Server中的完整的錯誤信息如下:

at Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.QueryStatus(Guid& pguidCmdGroup, UInt32 cCmds, OLECMD[] prgCmds, IntPtr pCmdText) 
    at Microsoft.VisualStudio.Platform.WindowManagement.DocumentObjectSite.QueryStatus(Guid& pguidCmdGroup, UInt32 cCmds, OLECMD[] prgCmds, IntPtr pCmdText) 
    at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.QueryStatus(Guid& pguidCmdGroup, UInt32 cCmds, OLECMD[] prgCmds, IntPtr pCmdText) 
    at Microsoft.Internal.VisualStudio.Shell.Interop.IVsTrackSelectionExPrivate.Register() 
    at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConnectSelectionContext() 
    at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.Activate() 
    at Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService.viewManager_ActiveViewChanged(Object sender, ActiveViewChangedEventArgs e) 
    at System.EventHandler`1.Invoke(Object sender, TEventArgs e) 
    at Microsoft.VisualStudio.PlatformUI.ExtensionMethods.RaiseEvent[TEventArgs](EventHandler`1 eventHandler, Object source, TEventArgs args) 
    at Microsoft.VisualStudio.PlatformUI.Shell.ViewManager.SetActiveView(View view, ActivationType type) 
    at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ShowInternal(ShowFlags showFlags) 
    at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.<Show>b__26() 
    at Microsoft.VisualStudio.ErrorHandler.CallWithCOMConvention(Func`1 method) 
    at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.Show() 
    at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.MarshalingWindowFrame.<Microsoft.VisualStudio.Shell.Interop.IVsWindowFrame.Show>b__7a() 
    at Microsoft.VisualStudio.Shell.ThreadHelper.Invoke[TResult](Func`1 method) 
    at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.MarshalingWindowFrame.Microsoft.VisualStudio.Shell.Interop.IVsWindowFrame.Show() 
    at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VirtualProject.CreateDesigner(Urn origUrn, DocumentType editorType, DocumentOptions aeOptions, IManagedConnection con, String fileName) 
    at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VirtualProject.Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ISqlVirtualProject.CreateDesigner(Urn origUrn, DocumentType editorType, DocumentOptions aeOptions, IManagedConnection con, String fileName) 
    at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ISqlVirtualProject.CreateDesigner(Urn origUrn, DocumentType editorType, DocumentOptions aeOptions, IManagedConnection con, String fileName) 
    at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDocumentMenuItem.CreateDesignerWindow(IManagedConnection mc, DocumentOptions options) 
    at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDocumentMenuItem.InvokeDesigner(IManagedConnection connection) 
    at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDocumentMenuItem.Invoke() 
    at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolsMenuItemBase.MenuInvokedHandler(Object sender, EventArgs args) 
+0

你是否嘗試重新命名數據庫,回到它的舊名稱? (現在試試*可能會讓事情變得更糟。) –

回答

1

我終於找到了解決辦法 - 希望這可以幫助別人。 。 。

您將需要安裝有SQL Server和/或Visual Studio的第二臺計算機。然後使用第二臺計算機複製以下步驟中指定的.dll文件,並替換數據庫關係圖不起作用的計算機上的相應文件。

步驟1: 替換以下文件:C:\ Program Files文件(x86)的\ Common Files文件\微軟共享\可視化數據庫工具\ dsref80.dll

第2步: 以下文件夾替換所有文件:C:\ Program Files文件(x86)\ Common Files \ microsoft shared \ MSDesigners8 \

我這樣做了,所有以前的數據庫圖現在再次工作。

+0

感謝您發佈它。一年後,它幫助我解決了同樣的問題。有用。 –