attaching a DB in SQL Server 2005 RRS feed

  • Question

  • i have installed SQL Server Management Studio Express along with the SQL Server 2005 Express...i am unable to attach an existing DB...i get the following error when i right click on databases and then select attach: "Failed to retrieve data for request (Microsoft.SQLServer.Express.SmoEnum)"...where am i going wrong?

    Friday, October 19, 2007 4:58 PM

All replies

  • Hi,

    Probably you must be knowing, that there are two files (mdf and ldf). There are chances that the ldf file is missing, corrupted or might be edited by some other means. Try following steps and might be this will help you to sort out this.

    • Just rename the ldf file time being.
    • Try opening the mdf file through VS.Net (this will create another ldf file)
    • Once these steps are done, use MDF file to join to your SQL Server Express instance.

    These steps might help you to attach db. Let me know if it works.


    Saturday, October 20, 2007 6:07 AM
  • i get the error which i had mentioned in my previous post when i click on add button...which means i m unable to even browse a DB nd attach it...
    Saturday, October 20, 2007 11:14 AM
  • Hi,


    I think the problem is with ldf/mdf file itself. But just to try out, check whether your "SQL Browser" service is running or not. Go to Start > Run > Type "Services.msc" and check whether all services related to SQL are running or not.


    Here I'm publishing some links that are relevant to your case and might help you:





    Monday, October 22, 2007 6:38 AM
  • the SQL Server Browser service is running...i found 3 other services related to SQL...SQL Server,SQL Server Active Directory Helper, SQL Server VSS Writer...of which i am unable to start SQL Server Active Directory Helper....i get the error
    "Windows couldnot start Active Directory Helper on local computer. Review System Event Log"

    also, i tried the procedure given in the links which you had specified...but no luck...i am creating a connection using Windows authentication since i m unable to use SQL Server authentication...watever login and pwd i give, i am unable to login...i still get the same error when i try to attach a new DB which i had created using SQL Server 2000 :

    "Failed to retrieve the data request (Microsoft.SqlServer.Express.SmoEnum). An exception occured while executing Transact-SQL stmt or batch. The Server Principal Preethi-PC\Preethi is not able to access the database "model" under the current security context"

    where do u think i m going wrong?i m sure the solution is going to be easy nd simple...nd tat i m making a silly mistake somewhere...its just tat i m unable to find it... i have to attach tis db to my project...which is due tis weekend... Sad
    Tuesday, October 23, 2007 1:46 PM
  • Hi,


    The cause can be the connection string. Whenever you'll be using Windows Authentication, you don't need to provide the Username and Password. SQL Server takes it automatically. You just need to specify "Integrated Security = True".


    Then your Connection String should look like:


    Data Source='machine_name';Integrated Security=True;Initial Catalog='dbname'


    Please note the changes. Might be this will work out. If still, it doesn't work, then please try out it on another machine. The cause can be either corrupted mdf/ldf files OR incorrect connection string.


    Mayur Tendulkar
    Tuesday, October 23, 2007 2:17 PM