Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>ANOTHER EDIT</strong> </p> <p>Cory, if you have previous versions of SQL Server installed (e.g. 2008), that is the version of <code>sqlcmd</code> you are using. In order to connect to LocalDb you need to be using the SQL Server 2012 version of <code>sqlcmd</code>. So your instructions to your users must ensure that they use the SQL Server 2012 version by running:</p> <p><code>C:\Program Files\Microsoft SQL Server\110\Tools\Binn\sqlcmd -S "(localdb)\.\InstanceName"</code></p> <p>This worked for me. What I haven't verified is whether this path and version of <code>sqlcmd</code> is available to users who have <em>only</em> installed the sqllocaldb.msi. Sorry but I don't have any naked machines without SQL Server 2012 installed (or with only previous versions installed) to try this out thoroughly. But please let me know if explicitly calling the 110 version of <code>sqlcmd</code> does the trick.</p> <p>I think you may also be able to instruct users to alter their system variables so that the 110 versions come first (which IMHO should be the case automatically).</p> <p>The <code>FileTimeToSystemTime</code> has been confirmed as a bug by one of Krzysztof's co-workers. So there is still no fix that I know of for non-owners to connect via <code>sqllocaldb</code>. But I've shown that both SSMS and <code>sqlcmd</code> can be made to work, so I hope that gets you closer to running.</p> <p><strong>EDIT</strong> </p> <p>You need to add any non-owner users to the instance, e.g. <code>CREATE LOGIN [MyDomain\OtherUser] FROM WINDOWS;</code> and any appropriate permissions as well. In my test login was failing and generating the wrong error message (the "FileTimeToSystemTime" error message is a bug). You also need to <code>GRANT CONNECT</code>. Once you do this, you <em>will</em> be able to connect from the second user using Management Studio with this connection (the only one I tried):</p> <pre><code>(localdb)\.\MySharedInstance </code></pre> <p>But from <code>sqlcmd</code>, I still I get an error no matter how I try to connect:</p> <pre><code>sqlcmd -S "(localdb)\.\MySharedInstance" sqlcmd -S ".\MySharedInstance" sqlcmd -S "(localdb)\MySharedInstance" sqlcmd -S "GREENHORNET\MySharedInstance" sqlcmd -S ".\LOCALDB#SH04FF8A" sqlcmd -S "GREENHORNET\LOCALDB#SH04FF8A" </code></pre> <p>All yield:</p> <blockquote> <p>HResult 0xFFFFFFFF, Level 16, State 1 SQL Server Network Interfaces:</p> <p>Error Locating Server/Instance Specified [xFFFFFFFF]. </p> <p>Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..</p> <p>Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Login timeout expired.</p> </blockquote> <p>Though I have verified that the instance is set to accept remote connections. So there is some other hoop that <code>sqlcmd</code> must be going through.</p> <p>And regarding the <code>sqllocaldb</code> exe, how does this follow any logic? I can see the instance is there via <code>info</code>, I get a proper error message when I try to stop it, I get a message that it is [already] started when I try to start it, but I can't connect to it?</p> <p><img src="https://i.stack.imgur.com/B57Tx.png" alt="enter image description here"></p> <p>So unless you <em>need</em> <code>sqlcmd</code> access, in the short term I would have the secondary users do their thing with SSMS (once you've granted adequate permissions) and hopefully Krzysztof will have more info on the other items.</p> <hr> <p>Regarding the 4.0.2 update, from <a href="http://connect.microsoft.com/SQLServer/feedback/details/723737/smo-cant-connect-to-localdb-instances" rel="noreferrer">http://connect.microsoft.com/SQLServer/feedback/details/723737/smo-cant-connect-to-localdb-instances</a>:</p> <blockquote> <p>We made an explicit decision not to include .NET Framework 4.0.2 in LocalDB installer. Installing the .NET Framework update would increase the size of the LocalDB installer and cause a likely reboot. Since LocalDB is built to be independent of the .NET, we didn’t think we should take this cost for every LocalDB installation. Future .NET versions (including .NET 4.5, now in CTP) will support LocalDB out of the box. Some developers may also want to opt in for ODBC, PHP Driver/PDO, and probably JDBC in the future. Those developers will not be interested in updating .NET.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload