Error: Failed to generate a user instance of SQL Server

前端 未结 11 1631
無奈伤痛
無奈伤痛 2020-12-02 14:54

I\'m trying to connect to an MDF. I\'ve even gone to the lengths of re-installing sql server express entirely (it is now the only flavor of SQL installed on my box, where p

11条回答
  •  时光取名叫无心
    2020-12-02 15:08

    I started getting this error this morning in a test deployment environment. I was using SQL Server Express 2008 and the error I was getting was

    "Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed."

    Unsure about what caused it, I followed the instructions in this post and in other post about deleting the "C:\Users\UserName\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS" directory, but to no avail.

    What did the trick for me was to change the connection string from

    "Data Source=.\SQLExpress;Initial Catalog=DBFilePath;Integrated Security=SSPI;MultipleActiveResultSets=true"
    

    to

    "Data Source=.\SQLExpress;Initial Catalog=DBName;Integrated Security=SSPI;MultipleActiveResultSets=true" 
    

提交回复
热议问题