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.

I had to uninstall and reinstall SQL server 2005 and Express on my development machine. After the un-installation, I reinstalled SQL 2005 standard then SQL Express. When I tried to open a SQL express database in VS2k5 I got the error “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.” After much searching, I found out the solution.

  1. Open SQL Server Configuration Manager. Navigation to Start > Microsoft SQL Server 2005 > Configuration Tools > SQL Server Configuration Manager

  2. Double-click SQL Server (SQLEXPRESS) and change it to use LocalSystem

  3. Delete the folder
    Windows Vista: C:\Users\[user]\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS
    Windows XP: c:\Documents and Settings\[user]\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS
    more info at: http://forums.microsoft.com/msdn/showpost.aspx?postid=98346&siteid=1

That’s it.

Does that fix your problem?