Cannot attache a database
-
Friday, May 25, 2012 9:21 PM
Install SQL Express 2008 Advanced Services RC0 and launched SSMS2008 to attach some database files from previous 2008 install. But was unable to do so becuase of the following error...
Ho do I fix, reinstall or ?
Code Snippet===================================
Cannot show requested dialog.
===================================Parameter name: nColIndex
Actual value was -1. (Microsoft.SqlServer.GridControl)
------------------------------
Program Location:at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidthInternal(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidthInternalForPublic(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidth(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.SetGridColumnWidth(SqlManagerUIDlgGrid grid, Double[] columnWidthRatio, Int32 columnIndex)
at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.SetDatabasesGridColumnWidths()
at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.OnScale()
at Microsoft.SqlServer.Management.SqlMgmt.SqlManagementUserControl.ScaleToFont()
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.DynamicallyEmbedUserControl(ViewInfo vi, TreeNode node)
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)I tried to run the following query to get rid of the bug:
sp_attach_db @dbname=N'myFirstDatabase', @filename1=N'C:\myWebNSOnlineCRMS\App_Data\myFirstDatabase.mdf', @filename2=N'C:\myWebNSOnlineCRMS\App_Data\SQLmyFirstDatabase_LOG.ldf'
Then i got this error:
Msg 262, Level 14, State 1, Line 1
CREATE DATABASE permission denied in database 'master'.Help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Christian Winters
- Edited by hewgnqeogmaw Friday, May 25, 2012 9:22 PM
All Replies
-
Friday, May 25, 2012 10:19 PM
- Proposed As Answer by Maggie LuoMicrosoft Contingent Staff, Moderator Monday, May 28, 2012 8:58 AM
- Marked As Answer by Maggie LuoMicrosoft Contingent Staff, Moderator Sunday, June 03, 2012 2:41 PM
-
Friday, May 25, 2012 10:59 PM
When you run SQL Server Management Studio, right click the icon and select "Run as administrator".- Proposed As Answer by irusulMicrosoft Community Contributor Friday, May 25, 2012 10:59 PM

