up vote 0 down vote favorite
1

Hi,

We're getting the following error when trying to establish a connection to a database file in the project:

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.

Any ideas on how we can fix it?

Thanks in advance!

flag

What edition & version of SQL Server are you using? – Nick Kavadias Aug 10 '09 at 16:00
SQL 2008 Express – stringo0 Aug 10 '09 at 16:19
Did you create the database using visual studio? If so I've added another potential solution to my answer. Sorry the other answer didn't work out. – apocalypse9 Aug 10 '09 at 17:25

3 Answers

up vote 1 down vote accepted

http://jeremywadsworth.com/Default.aspx?blogentryid=56 has one possible fix.

http://forums.asp.net/t/1377174.aspx also has further discussion on the topic.

Hope that helps.

--

One more idea. I think I've encountered something like this when using Visual studio to create and access my database. You can detach your database file from visual studio and then directly attach it to your SQL server. I can't remember if the problem manifested in the same way or not but this should get you around the user instance issue. If this doesn't apply let me know and I'll see if i can come up with anything else.

link|flag
We're currently testing this solution (deleting the SQLExpress folder) – stringo0 Aug 10 '09 at 16:20
We've tried this, and it is not solving the problem :[ – stringo0 Aug 10 '09 at 16:37
Update on the second suggestion - I think the db was created in visual studio - we are able to access it in SQL Management Studio Express, but not in Visual Studio itself - it's weird. (On one machine it's fine, but not on the other) Also, the solution builds and runs successfully - it's able to access the database while it's actually running. – stringo0 Aug 11 '09 at 16:56
up vote 0 down vote

SQL Express file attach starts a new 'user instance' SQL Server. This involves a new master/model/msdb/tempdb set of files that are created in the user settings data folder. also the startup of the new 'user instance' can take up to several minutes on extreme cases.

This MSDN article on SQL Server 2005 Express Edition User Instances cover in detail the process and luckly it has some Common Issues and fixes. The most common failure is due to access rights over the user settings copied files. You will usualy get details about the failure in your NT event log (ie. why did the child instance not start).

link|flag
up vote 0 down vote

We got over this by copying the database from my machine to my team-mate's.

link|flag

Your Answer

get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.