Answered 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


All Replies