更改数据库名称后,数据库图表无法访问

时间:2013-05-31 11:46:38

标签: sql-server

我有一个SQL服务器数据库,我最近通过SSMS重命名。 除了我不能再访问数据库图表或创建新的数据库图表外,数据库整体工作正常。每当我尝试这样做时,都会收到以下错误消息 -

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

如何重新获得数据库图表的访问权限,或者至少清除它们并能够再次创建新图表?

编辑:我刚刚注意到SQL Server中的任何数据库都无法访问数据库图,而不仅仅是重命名的数据库。

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)

1 个答案:

答案 0 :(得分:1)

我最终找到了一个解决方案 - 希望这可能有助于其他人。 。

您需要安装SQL Server和/或Visual Studio的第二台计算机。然后使用第二台计算机复制以下步骤中指定的.dll文件,并替换数据库图表不工作的计算机上的相应文件。

第1步: 替换以下文件:C:\ Program Files(x86)\ Common Files \ microsoft shared \ Visual Database Tools \ dsref80.dll

第2步: 替换了以下文件夹中的所有文件:C:\ Program Files(x86)\ Common Files \ microsoft shared \ MSDesigners8 \

我这样做了,之前的所有数据库图表现在都在重复使用。