<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Connecting to SQL Express User Instances in Management Studio</title><link>http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx</link><description>Many of you are working with User Instances , sometimes without even realizing it. Briefly, a User Instances is special process of SQL Express that can be started by an application at runtime and allows SQL Express to emulate some of the characteristics</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Connecting to SQL Express User Instances in Management Studio</title><link>http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx#1166120</link><pubDate>Tue, 28 Nov 2006 19:06:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1166120</guid><dc:creator>Ross Shen</dc:creator><description>&lt;p&gt;When I use the following connection string without &amp;quot;User Instance=TRUE&amp;quot;, I noticed my database is attached to the SQLEXPRESS instance itself and is operable. Why I need to bother adding &amp;quot;User Instance=TRUE&amp;quot; and following your steps.&lt;/p&gt;
&lt;p&gt;connectionString=&amp;quot;Data Source=.\SQLEXPRESS;AttachDBFilename=|DataDirectory|Northwind.mdf;Integrated Security=True;&lt;/p&gt;
&lt;p&gt;Second question, it seems that once the user instance goes alive, it will not go back to dead even though I restart the SQL service. Can you explain this?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Ross&lt;/p&gt;
</description></item><item><title>re: Connecting to SQL Express User Instances in Management Studio</title><link>http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx#1166566</link><pubDate>Tue, 28 Nov 2006 21:10:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1166566</guid><dc:creator>sqlexpress</dc:creator><description>&lt;p&gt;Here is an answer for Ross' question:&lt;/p&gt;
&lt;p&gt;User Instances were designed to allow non-administrative users to be able to attach a database &amp;quot;on the fly&amp;quot; during applicaiton runtime. (This explains the name of the feature, which is Run As Normal User.) This is in order to support ClickOnce deployment of single user, Windows application that use locally stored data.&lt;/p&gt;
&lt;p&gt;Two things have to be true for AttachDBFilename to work:&lt;/p&gt;
&lt;p&gt;1. The user has to have CREATE privledges on SQL Server.&lt;/p&gt;
&lt;p&gt;2. SQL Server has to have access to the path represented by |DataDirectory|&lt;/p&gt;
&lt;p&gt;Under default conditions, non-Administrator users will not have CREATE privledge, so the command line you specify would fail for them. Additionally, the default service account used by SQL Express do not have permissions for any of directories in a user profile, such a My Documents, which is the default location for databases created by VS. In your case, either you have given the Network Service account permissions for your user profile directories, or you are running SQL Express under a different account that does have permissions for those directories. (Or |DataDirectory| is pointed to somewhere that is not in a user profile.)&lt;/p&gt;
&lt;p&gt;As an interesting side note, the connection string you reference will probably fail when run on Vista with User Account Control turned on because SQL Express will no longer percieve you as an Administrator on the computer. UAC automatically removes your Admin Tokens and treats you as a normal user until you do something to elevate the privledges of the application you are running. There are post else where in this blog discussing Vista and SQL Express.&lt;/p&gt;
&lt;p&gt;- Mike&lt;/p&gt;
&lt;p&gt;This would be a great question to ask on the SQL Express forum as well. (&lt;a rel="nofollow" target="_new" href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=385&amp;amp;SiteID=1"&gt;http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=385&amp;amp;SiteID=1&lt;/a&gt;)&lt;/p&gt;
</description></item><item><title>re: Connecting to SQL Express User Instances in Management Studio</title><link>http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx#1166597</link><pubDate>Tue, 28 Nov 2006 21:15:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1166597</guid><dc:creator>sqlexpress</dc:creator><description>&lt;p&gt;Opps, forgot the second question...&lt;/p&gt;
&lt;p&gt;You're right. A User Instances is a completely separate process from the parent instance of SQL Express. Once it has been started, it is completely autonomous from the parent, shutting down the parent will have no impact on the User Instance. A User Instance will automatically time out after 60 minutes, and it will get shut down and not come back if you shut down your computer.&lt;/p&gt;
&lt;p&gt;You can see the User Instance process in the Windows Task Manager, do something that starts a User Instance and then take a look at the Processes tab. You should see two occurances of sqlservr.exe, one will be running as the SQL Express service account (Network Service by default) and the second will be running under your own user account. It is interesting to note that a User Instances runs as a Process, not as a Service as the parent instance does.&lt;/p&gt;
&lt;p&gt;- Mike&lt;/p&gt;
</description></item><item><title>how to connect to SQL Express User Instances</title><link>http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx#2298169</link><pubDate>Fri, 27 Apr 2007 13:26:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2298169</guid><dc:creator>Shervin Shakibi's Blog</dc:creator><description>&lt;p&gt;how to connect to SQL Express User Instances&lt;/p&gt;
</description></item><item><title>re: Connecting to SQL Express User Instances in Management Studio</title><link>http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx#2669132</link><pubDate>Wed, 16 May 2007 12:36:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2669132</guid><dc:creator>hbkelkar</dc:creator><description>&lt;p&gt;hi&lt;/p&gt;
&lt;p&gt;I am writing applications in VB6 and using SQL Express as a backend.&lt;/p&gt;
&lt;p&gt;My client network is working on some Windows98 machines and some on Win XP.&lt;/p&gt;
&lt;p&gt;I can easily connect to the database (SQL Express) &amp;nbsp;from winXP client machines using SQL Native Client,SQLNCLI&lt;/p&gt;
&lt;p&gt;I need to know.. whether i can connect to the Database from Windows98 OS.? &lt;/p&gt;
&lt;p&gt;If it is possible, how to establish a connection string to work on both win98 and Win XP machines.&lt;/p&gt;
</description></item><item><title>re: Connecting to SQL Express User Instances in Management Studio</title><link>http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx#3226856</link><pubDate>Mon, 11 Jun 2007 13:36:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3226856</guid><dc:creator>aslanozcakir@hotmail.com</dc:creator><description>&lt;p&gt;We need to connect to SQL Express instance remotely from another server.&lt;/p&gt;
&lt;p&gt;We used an alias to map the remote server and sql express server but we can not connect.&lt;/p&gt;
&lt;p&gt;We are getting the default cannot connect error message.&lt;/p&gt;
&lt;p&gt;First of all, we need to know whether we can connect to SQL Express Server remotely because we are confused with the following statement:&lt;/p&gt;
&lt;p&gt;&amp;quot;By Default, SQL Express, Evaluation and Developer editions allow local client connections only&amp;quot;&lt;/p&gt;
&lt;p&gt;this is written at : SQL Server 2005 Surface Area Configuration's dialog box.&lt;/p&gt;
&lt;p&gt;Please advise.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Aslan Ozcakir&lt;/p&gt;
</description></item><item><title>re: Connecting to SQL Express User Instances in Management Studio</title><link>http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx#3708543</link><pubDate>Thu, 05 Jul 2007 19:53:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3708543</guid><dc:creator>sqlexpress</dc:creator><description>&lt;p&gt;Response for Aslan:&lt;/p&gt;
&lt;p&gt;Hi Aslan,&lt;/p&gt;
&lt;p&gt;User Instances do not support remote connections at all. You cannot connect to them in the manner you are trying.&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;
</description></item><item><title>re: Connecting to SQL Express User Instances in Management Studio</title><link>http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx#7894820</link><pubDate>Mon, 25 Feb 2008 20:33:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7894820</guid><dc:creator>RWGAU</dc:creator><description>&lt;p&gt;My problem is that when I log into my development PC as workstation only/local machine, everything works. &amp;nbsp;However, when I log in to the domain account I get a message stating that User does not have permission to run the action. (or something like that) &amp;nbsp;I've tried everything I can think of.&lt;/p&gt;
</description></item><item><title>re: Connecting to SQL Express User Instances in Management Studio</title><link>http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx#8277578</link><pubDate>Mon, 17 Mar 2008 05:24:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8277578</guid><dc:creator>derekgreer</dc:creator><description>&lt;p&gt;I know this problem has been reported all over the place, but none of the threads have helped so far.&lt;/p&gt;
&lt;p&gt;I'm running SQL Express on Vista. &amp;nbsp;I have a database file set up for ASP.Net Authentication. &amp;nbsp;I can connect to this database through Visual Studio, IIS 7.0 User Administration, and SSEUtil. &amp;nbsp;However, I cannot connect to the database when accessing it from a Web request. &amp;nbsp;Upon attempting to access the database, the web site returns the error:&lt;/p&gt;
&lt;p&gt;&amp;quot;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.&amp;quot;&lt;/p&gt;
&lt;p&gt;I'm running SQLExpress as &amp;quot;Network Service&amp;quot; as intended. &amp;nbsp;Any ideas what could be wrong?&lt;/p&gt;
&lt;p&gt;Derek&lt;/p&gt;
</description></item><item><title>re: Connecting to SQL Express User Instances in Management Studio</title><link>http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx#8291695</link><pubDate>Mon, 17 Mar 2008 19:48:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8291695</guid><dc:creator>sqlexpress</dc:creator><description>&lt;p&gt;Response for Derek:&lt;/p&gt;
&lt;p&gt;You should check out the blog post at &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/sqlexpress/archive/2008/02/22/sql-server-express-and-hosting.aspx"&gt;http://blogs.msdn.com/sqlexpress/archive/2008/02/22/sql-server-express-and-hosting.aspx&lt;/a&gt;. In short, User Instances provide some great developer productivity features, but are not an appropriate technology for Hosted databases for exactly the types of issues you are experiencing.&lt;/p&gt;
&lt;p&gt;In order to correctly access the database correctly through the web site, you should move the database to be connected to the parent instances and change your connection string. There are links in the blog post that show how to use the Database Publishing Wizard to do this, even to the point of combining your Membership database with your data database.&lt;/p&gt;
&lt;p&gt;You can use SQL Express as the server to host your application databases, but be aware that the physical limitations on SQL Express may impact your performance as the load on your web site increases.&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;
</description></item><item><title>re: Connecting to SQL Express User Instances in Management Studio</title><link>http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx#8300715</link><pubDate>Tue, 18 Mar 2008 04:14:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8300715</guid><dc:creator>derekgreer</dc:creator><description>&lt;p&gt;Mike,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;I appreciate the recommendation, but I'm interested in solving this problem more for academic reasons than anything else. &amp;nbsp;I'm not running any sort of major Web site.&lt;/p&gt;
&lt;p&gt;I recently ran into some installation problems with SQL Standard Edition on Vista which required me to reinstall SQL Express. &amp;nbsp;Prior to this reinstall, I had a Web site configured to use ASP.Net authentication with SQL Server Express which was working fine. &amp;nbsp;After reinstalling SQL Express, I started getting the &amp;quot;cannot create user instance&amp;quot; error message. &amp;nbsp;My previous installation was the result of a VS2005 install. &amp;nbsp;This process must have installed SQL Server Express differently than I did, because everything was working just fine with user instances.&lt;/p&gt;
&lt;p&gt;That said and recommendations for not using user instances duly noted, I would like to determine what is wrong with my present configuration which would cause this problem. &amp;nbsp;I'm not interested in solving the problem by avoiding the use of SQL Express or avoiding the use of user instances as the purpose of my quest is to determine what went wrong and how this works.&lt;/p&gt;
&lt;p&gt;Here is a list of information if you think you can help with this problem:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;* Running on Vista Ultimate&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;* Running SQL Server Express 2005&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;* Connection string: data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;* Was working before uninstalling and reinstalling SQL Server Express 2005&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;* SQLExpress service is run as user “Network Service”&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;* &amp;quot;Network Service&amp;quot; has full permissions on App_Data, MDF, and LDF&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;* “Network Service” has execute permissions on “sqlservr.exe”.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;* All IIS 7.0 Application Pools are running as “Network Service”&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;* No other processes currently have the files locked&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;* User instance creation works fine when accessed through IIS 7.0 User administration, SSEUtil, and VS2005&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;* User instance cannot be created when accessed via Web request&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;* Event Viewer reports: “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. [CLIENT: &amp;lt;local machine&amp;gt;]” for user “Network Service”&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Derek&lt;/p&gt;
</description></item><item><title>re: Connecting to SQL Express User Instances in Management Studio</title><link>http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx#8319288</link><pubDate>Tue, 18 Mar 2008 21:18:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8319288</guid><dc:creator>sqlexpress</dc:creator><description>&lt;p&gt;Response to Derek -&lt;/p&gt;
&lt;p&gt;The short story is that I don't know what is wrong with your system. We've not been able to track down the root cause of this error. I do know that it has nothing to do with the way you installed SQL Express or the source of your SQL Express installation.&lt;/p&gt;
&lt;p&gt;This particular error is returned when SQL Express sends a request to Windows to have a new process started and Windows returns a NULL rather than starting the process. We haven't been able to determine why Windows can't start the process.&lt;/p&gt;
&lt;p&gt;There are a couple conditions that may be impacting your specific case:&lt;/p&gt;
&lt;p&gt;- User Instances only work for interactive users because system files need to be copied into folders in the user profile. I notice you are running your Application Pool as Network Service and I don't believe there is a profile for Network Service, so there is nowhere to copy the system files. You could try changing your Application Pool to run as an interactive user for which a set of profile folders exists.&lt;/p&gt;
&lt;p&gt;- If there is a profile for Network Services, you can try deleting the user instance folder so that it is recreated the next time you start the user instance. This frequently works for normal user accounts. The user instance folder is located at C:\Users\&amp;lt;username&amp;gt;\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS&lt;/p&gt;
&lt;p&gt;Again, user instances are not appropriate for hosted applications. I know you're on a mission to figure out why something is failing, but does it make sense to spend your time on this given that there is a better solution available to you? Just a thought.&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;
</description></item><item><title>re: Connecting to SQL Express User Instances in Management Studio</title><link>http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx#8324380</link><pubDate>Wed, 19 Mar 2008 04:32:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8324380</guid><dc:creator>derekgreer</dc:creator><description>&lt;p&gt;To answer your question about whether it makes sense to spend time trying to solve this problem, I would say the answer to this question depends on one's perspective. &amp;nbsp;It's a bit of a &amp;quot;Why climb the mountain&amp;quot; issue in my case. &amp;nbsp;I can't say its always been easy to have the type of personality that drives me to figure out stuff like this, but overall its certainly benefited me professionally.&lt;/p&gt;
&lt;p&gt;Concerning your statement about user instances only working with interactive user accounts, if this is true then I'm really baffled. &amp;nbsp;My Web site was working with user instances just a few days ago and I know for certain I haven't changed the account my Application Pool runs under or the Application Pool associated with my site.&lt;/p&gt;
&lt;p&gt;Concerning there being a profile for Network Services, I know that there isn't currently a C:\Users\Network Service folder so I assume it wasn't there in the past either.&lt;/p&gt;
&lt;p&gt;If only I had a time machine ...&lt;/p&gt;
&lt;p&gt;- Derek&lt;/p&gt;
</description></item><item><title>Connecting to SQL Server express user instances in management studio</title><link>http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx#8899073</link><pubDate>Wed, 27 Aug 2008 09:13:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8899073</guid><dc:creator>DotNetKicks.com</dc:creator><description>&lt;p&gt;You've been kicked (a good thing) - Trackback from DotNetKicks.com&lt;/p&gt;
</description></item><item><title>FAQ: Error creating a Service-based database in Visual Studio 2008 SP1</title><link>http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx#8974681</link><pubDate>Fri, 03 Oct 2008 03:07:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8974681</guid><dc:creator>SQL Server Express WebLog</dc:creator><description>&lt;p&gt;A few of you have run into problems when trying to add a new Service-based database to your project in&lt;/p&gt;
</description></item><item><title>re: Connecting to SQL Express User Instances in Management Studio</title><link>http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx#9928127</link><pubDate>Tue, 24 Nov 2009 18:08:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9928127</guid><dc:creator>kasun087</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I found this very much helping and interesting. I am having a similar problem related to this thread. I have created a small business application by visual c sharp 2005. &lt;/p&gt;
&lt;p&gt;After reading this thread i happened to know that i have created an user instance. I installed sql management studio 2005 express manually and even thought my application is not running the heat beat still shows it s alive.(But i created an exe file to deploy the application in client's machine)&lt;/p&gt;
&lt;p&gt;So far everything is fine.But i need to do some backup taking at the client machine. So when i tried to connect to the database which i have deployed into my application, i could not find that database from the management studio. Is there any possible solution you have with this issue Mike? It would be really helpful if you can suggest me something on this matter &lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
</description></item></channel></rss>