Learn more about SQL Server tools



solving sql server problems for millions of dbas and developers since 2006 join MSSQLTips for free SQL Server tips













































   Got a SQL tip?
            We want to know!

Getting Started with SQL Server 2012 Express LocalDB

MSSQLTips author Aaron Bertrand By:   |   Read Comments (53)   |   Related Tips: More > Express Edition
Problem

Developers using SQL Server Express face a few challenges in their day to day work. One is that setting up and maintaining Express can be a daunting task. Another is that using the "User Instances" feature (which has been deprecated) leads to a lot of confusion - developers connect to one instance of the database through their tools, and another instance of the database through their program, and don't understand why updates to one aren't reflected in the other. This is actually due to the AttachDbFileName setting, but in most examples I've seen, the two seem to go hand in hand.

Solution

SQL Server 2012 introduces a new feature, SQL Express LocalDB. The purpose of this new feature is to provide developers with a local environment that is much easier to install and manage. Instead of installing a service and configuring security, they just start up an instance of this new LocalDB runtime as needed. In addition, the download for the SQL Express LocalDB runtime is only about 33 MB (or 27 MB, if you are still on x86), compared to the 100s of MBs required to download a full edition of SQL Server Express.

Before you get started, you'll want to make sure that your operating system is patched to the latest service pack and current according to Windows Update. Supported operating systems are as follows:

  • Windows 7
  • Windows Server 2008 R2
  • Windows Server 2008 Service Pack 2
  • Windows Vista Service Pack 2

It will also work on Windows 8 if you're using any of the pre-release versions, but I have not tested this on any of the Server Core variants of Windows Server, so you're on your own there. For further information on system requirements, please see Hardware and Software Requirements for Installing SQL Server 2012.

You'll want to make sure that you've installed .NET Framework 4.0 and, equally as importantly, the .NET Framework 4.0.2 update (KB #2544514).

Once your system is up to date, you can download the SqlLocalDb installer from:

http://www.microsoft.com/en-us/download/details.aspx?id=29062

Setup is rather trivial:

SQL Server 2012 introduces a new feature, SQL Express LocalDB
SQLLocalDB installer
Ready to Install
Installing SQL Server 2012 Express LocalDB
Completing the installation

Once installed, you can interact with SqlLocalDb using the command line. The following will tell you the version of SqlLocalDb:

C:\> SqlLocalDb info

Result:

v11.0

If you want to create an instance:

C:\> SqlLocalDb create "MyInstance"

Result:

LocalDB instance "MyInstance" created with version 11.0.

To start the instance:

C:\> SqlLocalDb start "MyInstance"

Result:

LocalDB instance "MyInstance" started.

You can also create an instance and start it in one command using the -s argument:

C:\> SqlLocalDb create "MyInstance" -s

To stop and delete an instance, you can issue two commands:

C:\> SqlLocalDb stop   "MyInstance"
C:\> SqlLocalDb delete "MyInstance"

If you try to just delete the instance without first stopping it, you will get this error:

Delete of LocalDB instance "MyInstance" failed because of the following error:
Requested operation on LocalDB instance cannot be performed because specified instance is currently in use. 
Stop the instance and try again.

To check on the status and other details about an instance, you can run:

C:\> SqlLocalDb info "MyInstance"

Result:

Name:                MyInstance
Version:             11.0.2100.60
Shared name:
Owner:               METEORA\AaronBertrand
Auto-create:         No
State:               Running
Last start time:     4/29/2012 6:17:24 PM
Instance pipe name:  np:\\.\pipe\LOCALDB#ABB78D50\tsql\query

Now that an instance is created and started, you'll probably want to do other things like create databases and run queries. Unfortunately SqlLocalDb on its own only provides an interface to the engine; it does not provide a means to interact with databases. However there are several other ways to connect to and interact with SqlLocalDb instances.

sqlcmd

In order to use sqlcmd, you must install either SQL Server 2012 Management Studio Express or the client tools from a regular SQL Server 2012 edition (though I caution against using Evaluation Edition here, since the client tools will expire after 180 days). You can install just the SQL Server 2012 Command Line Utilities, but I will install Management Studio Express since it's free, supports all of the functionality you should need to manage LocalDB instances, and for most tasks is preferable to sqlcmd anyway. You can download Management Studio Express from this page:

http://www.microsoft.com/en-us/download/details.aspx?id=29062

As with SqlLocalDb, you'll want to pick the file that is appropriate for you, depending on whether you are running on x86 or x64. When the Installation Center opens, you'll want to pick the option "New SQL Server stand-alone installation or add features to an existing installation" - even though neither describes what you're really doing.

Management Studio Installation Center

On the Product Updates screen, you can uncheck the box to prevent it from checking the web for updates (or to prevent it from timing out in the event you have slow or no connectivity). At the time of writing no updates were found anyway.

Product Updates screen

While it should be checked by default, make sure that on the Feature Selection screen, "Management Tools - Basic" is selected.

Feature Selection screen

Once installed, you can connect to the local instance using sqlcmd. Be sure to use the most recent version of sqlcmd on your system; if you have multiple versions (e.g. from previous versions of SQL Server or Visual Studio), calling sqlcmd will pick up the first one in your PATH environment variable, which is almost certainly going to be the earlier version. You can create a shortcut to cmd setting the start location to:

C:\Program Files\Microsoft SQL Server\110\Tools\Binn\

So now that sqlcmd is installed, and assuming you started an instance called "MyInstance" per above, you can connect using sqlcmd this way:

C:\Program Files\Microsoft SQL Server\110\Tools\Binn\> sqlcmd -S (localdb)\MyInstance
1> SELECT @@VERSION;
2> GO

Result:

sqlcmd result of SELECT @@VERSION

So now you can create a database, create a table, etc.

1> CREATE DATABASE foo;
2> GO
1> USE foo;
2> GO
Changed database context to 'foo'.
1> CREATE TABLE dbo.bar(ID INT);
2> GO
1> exit

Management Studio / Management Studio Express

We can connect to this instance using Management Studio Express in a similar way. You can launch ssms.exe from the cmd line, and when prompted for a connection, use the server name "(localdb)\MyInstance":

SSMS Connect to Server dialog

Here is the database / table we created through sqlcmd (we could of course continue adding/editing objects from Management Studio):

SSMS Object Explorer

One thing you'll want to make note of is the location of databases in a SqlLocalDb instance. As described in this blog post, databases are by default created in your user profile directory. So if your profile is on C:\ and that drive is short on space, or if you want to create your databases on other drives for whatever reason, you'll need to use explicit locations in your CREATE DATABASE statement, e.g. to put the data file on D:\ you can say:

CREATE DATABASE foo ON (name = 'foo_data', filename = 'D:\dev\foo_data.mdf');

It would be nice if you could set the default data / file paths for the SqlLocalDb instance so that you didn't have to specify the locations every time, but this screen is greyed out:

Server Properties dialog

SQL Server Data Tools

In addition to using sqlcmd and Management Studio Express, you can download SQL Server Data Tools (SSDT), which also installs the Visual Studio 2010 Shell if you don't already have some edition of Visual Studio 2010 installed. You can download SSDT from the following site:

http://msdn.microsoft.com/en-us/data/hh297027

Eventually this will launch the Web Platform Installer:

Web Platform Installer
Web Platform Installer

Once you've installed SSDT, you can launch the program, create a new SQL Server Database Project, and use the new (localdb) instance it creates:

SQL Server Data Tools - Create Project

But you can also use "Add Server..." to connect to and work with your existing instance:

SQL Server Data Tools - Add Server
SQL Server Data Tools - Connect to Server
SQL Server Data Tools - Object Explorer

Visual Studio

To use SqlLocalDb with Visual Studio proper, see the following blog post, where Roel van Lisdonk walks you through using both Visual Studio 2010 and the newer VS11 beta to connect to SqlLocalDb:

http://www.roelvanlisdonk.nl/?p=2607

PowerShell

It took me a little finagling to get PowerShell to connect to my LocalDB instance. Even with SQL Server 2012 client tools and the .NET 4.0.2 update installed, it seems that the version of SMO that PowerShell uses an older version of SMO that is not LocalDB-aware. Granted, this was Windows 7 without any explicit updates to PowerShell. While you should be able to connect using this syntax:

[Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null;
$sn = "(localdb)\MyInstance";
$srv = New-Object -typeName Microsoft.SqlServer.Management.Smo.Server -argumentList $sn;
$srv.ConnectionContext.LoginSecure = $true;
$srv.Databases | Select Name;

Various attempts at server names (such as (localdb)\.\MyInstance and .\MyInstance yielded generic "Failed to connect to server" errors. It turns out I had to connect using the named pipe syntax, which was necessary for other applications prior to the 4.0.2 update:

[Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null;
$sn = "np:\\.\pipe\LOCALDB#ABB78D50\tsql\query";
$srv = New-Object -typeName Microsoft.SqlServer.Management.Smo.Server -argumentList $sn;
$srv.ConnectionContext.LoginSecure = $true;
$srv.Databases | Select Name;

To determine that little hex code associated with the named pipe for the selected instance, you can use the SqlLocalDb info command. As you can see in the following screen shot, I just copied the output from the "Instance pipe name" line:

PowerShell connectivity

Note that this hex code will change every time you start the instance. Hopefully this issue will be fixed soon so that PowerShell can connect to SqlLocalDb instances just like the other applications can.

ADO.NET

In order to connect via ADO.NET, there is only a minor change in the way you specify your connection string. As per the above examples, you just use (localdb) in place of "." or "machine name":

Data Source=(LocalDB)\MyInstance;Initial Catalog=foo;Integrated Security=True;

This requires the .NET Framework 4.0.2 update, however, otherwise you'll have the same issues I disclosed about PowerShell, and you'll need to use the LOCALDB#HEX-PIPE connection format.

Conclusion

Hopefully this gives you a jump start in using SQL Server 2012 Express LocalDB for local development. There are other aspects I haven't touched on, that I may treat in future tips - for example, sharing instances with other users, and the fact that LocalDB is named as such for a reason: it does not accept remote connections.

Next Steps


Last Update: 5/16/2012


About the author
MSSQLTips author Aaron Bertrand
Aaron Bertrand is a Senior Consultant at SQL Sentry, Inc., and has been contributing to the community for over a decade, first earning the Microsoft MVP award in 1997.

View all my tips
Related Resources


print tip Print  
Become a paid author





join MSSQLTips for free SQL Server tips     



Learn more about SQL Server tools
Comments and Feedback:
Wednesday, May 16, 2012 - 9:12:35 AM - Kamala Ayyar Read The Tip

Nice article!! Thanks


Wednesday, May 23, 2012 - 3:49:56 PM - greg aiken Read The Tip

i am very interested to see if/how LocalDb can be useful to our organization.  my biggest problem is that i dont see any 'errorlog' file thats associated with LocalDb.  

for troubleshooting purposes, sqlexpress has a \Log directory and an active 'errorlog' file where bad login attempts, informational status, errors related to trying to create database backups and/or restores are also logged.

i would think such things would also be useful to know for a LocalDb instance.

do you have any insights into this?

also have you discovered any way to get LocalDB, and matching cli utility, to work on Windows XP?  ive been successful to install AND USE SUCCESSFULLY the sql2012 'sqlncli11' client connectivity library on Windows XP 32 bit.  ive also been succesful to install AND USE SUCCESSFULLY the sql2012 'sqlcmd' on Windows XP 32 bit.  Ive also been able to install LocalDB onto Windows XP 32-bit, however it unfortunately does not run (as there is a dependency for dlls that ship with Windows Vista or Seven - which obviously, are not normally found in Windows XP.

greg


Wednesday, May 23, 2012 - 6:23:45 PM - Aaron Bertrand Read The Tip
Hi greg, There is certainly an error log for LocalDB instances. You can see this in Management Studio just like any other SQL Server instance: Management > SQL Server Logs. If you want to locate the files directly, you have to dig a little deeper; they're stored in the same folder where databases are created by default: C:\Users\\AppData\Local\Microsoft Microsoft SQL Server Local DB\Instances\ The current error log is simply called error.log. As for Windows XP, sorry, I haven't really looked into that, since that OS is so old (and I doubt you should expect any official support from Microsoft). You're probably safer on those machines to just stick with normal SQL Server Express.

Wednesday, May 23, 2012 - 6:24:52 PM - Aaron Bertrand Read The Tip
Whoa, I have no idea what happened to the formatting on that reply, sorry. The current error log is in: C:\Users\[your user name]\AppData\Local\MicrosoftMicrosoft SQL Server Local DB\Instances\[instance name]\error.log

Thursday, May 24, 2012 - 11:04:17 AM - greg aiken Read The Tip

thanks tons.  so that takes care of my first main concern...

perhaps i could ask you one more...  my second concern is that all documentation states that in order to install LocalDB the user must be a member of the (local?) Administrators group.  i do realize LocalDb was primarily developed for 'developers' to use - and this would be understood that most application developers (eg; people who understand very well computing) would be (local?) Administrators on their own machines.

but if the aimpoint i have is a lighter weight, easier to install, easier to support database engine to be used by 'end users' (of an sql based application) - this is a different scenario.  each potential 'end user' could have different user account situations.  some could indeed be (local?) Administrators, and others could be domain users in a large organization where their IT management team FORBIDS the average user from having (local?) Administrator priveleges.

ideally - in my opinion - LocalDb 2012 is a 'step in the right direction'.  but i see a next release being ideally suited for 'end user' usage to add a new design aimpoint - remove the requirement of being an Administrator to install LocalDb.  If this restriction can be removed, then perhaps a future LocalDb 'user instance' could be freely and easily installed by a 'standard' windows user.  this would make sql based application (for 'stand alone' deployment) be much easier.

but since we are not there yet, and/or perhaps Microsoft's thought about above idea is not a match to mine, that leaves us with the present 'hard-requirement' of needing to be an Administrator to successfully install LocalDb 2012.  i believe LocalDb installs as a *.msi file.  do you know of any way the following can be robustly achieved?

a 'standard windows user' launches an install of LocalDb - and it is performed in a manner where it installs properly.  in other words, is there a way that a standard windows user can somehow force the installation to run elevated as Administrator, if they are not a member of the (local?) Administrators group?

ive read one may start 'msiexec' using '/a' parameter which somehow aims to do this, but it doesnt state if the user running such a command must be a member of Administrator group to effectively use the parameter.

i also know one may 'elevate a cmd window' to run as Administrator, the user may then cd into the directory that contains the *.msi file, then the user may invoke the full file name of the *msi installer.  this is far too complex of a sequence to expect computer non-savy end users to follow merely to install a program.  certainly there must be an 'easier' way...


Thursday, May 24, 2012 - 12:04:46 PM - Aaron Bertrand Read The Tip
It is not perfect. To install LocalDB you may have to be an administrator (I'm not sure, I don't work in an environment where developers' machines are that locked down). But once it is installed, you shouldn't have to be an administrator to create and use instances.

Thursday, May 24, 2012 - 12:40:22 PM - Aaron Bertrand Read The Tip
And a further thought - if your machines are locked down due to group policy, corporate rules, what have you - why is it a good idea to bypass that for SqlLocalDb? If the policy dictates that they shouldn't be installing software on their local machines, then they shouldn't be installing software on their local machines, and I'll suggest the same thing I've suggested elsewhere: maybe local development isn't the answer. They can do the same thing connecting to their own database on a SQL Server instance you manage elsewhere.

Thursday, May 24, 2012 - 1:58:25 PM - greg aiken Read The Tip

you bring up a good point.  

my day-to-day role is 'support' for a software company who sells sql based applications.  im constantly working with both end users and IT support staff to install/configure/troubleshoot the software my employer produces.

im used to being, at times, almost verbally assaulted by IT people (without any further qualification being made here...) who sometimes say to me 'why is your software so hard to install, i dont want to give person such and such admin priveleges to install your software with, blah, blah, blah, etc...'  

up till now, ive always had sort of an 'im the undergog' in this type of conversation.  your last statement (above) has given me a totally different perspective on this.  next time some IT person comes at me with this type of attitude, ill just respond with 'well its YOUR policy to not allow joe to install software he needs to use to do his job, that requires you work with me to install it!  so lets work together in a cherry fashion and be done with it.'

thanks for inspiring me to change my tact here.


Thursday, May 24, 2012 - 3:38:25 PM - Aaron Bertrand Read The Tip
Cheers greg, glad to help out in an unintended way. :-)

Wednesday, May 30, 2012 - 4:14:38 AM - A.Kadir Bener Read The Tip

Thanks for all descriptions. But there is an error i cannot fix...

I've already used the localdb on a small project. I tested and saw no problem.

But when i deployed the application some users complained about connection problems which says there is a network related error to connect (localdb)\v11.0 instance is not reachable.

I finally reproduced the error message. The setup is ok, the .Net 4.0.2 update is ok and all other Windows updates are ok. There is no error when the application is started with Administrator account.

But when a user account is used the exception throws and says that the sql server is not reachable. Do you have any idea for the customers who wants to use a username which have no administrator privileges on their computer.

Thank you.


Wednesday, May 30, 2012 - 8:52:16 AM - Aaron Bertrand Read The Tip
A.Kadir, did you share the instance using sqllocaldb -share? Did you try having the non-admin user create their own instance (why do they need to use an instance the admin created instead of just creating their own)? Please see this StackOverflow question and all the comments: http://stackoverflow.com/questions/10214688/why-cant-i-connect-to-a-sql-server-2012-localdb-shared-instance

Wednesday, May 30, 2012 - 12:02:23 PM - greg aiken Read The Tip

i think that what A.Kadir reports here - is what i saw as a potential deployment concern. the same concern is being phrased in two different ways.

 

if it is possible for a (non-administrator) 'user' to create their own 'instance' of localdb by running "sqllocaldb create MyInstance", my best guess here would be that ideally this sequence should auto-magically create a windows authenticated login for 'user' to that newly created 'instance'.  if this is indeed possible, that would be a very workable solution.  

 

in an application deployment scenario this could be achieved by either instructing the 'end user' to cd into the '...Microsoft SQL Server\110\Tools\Binn' folder and then run "sqllocaldb create MyInstance"...

 

-or-

 

supply them with a script that does this for them.

 

if, on the other hand, even if a 'user' is able to create their own localdb instance - but this instance is unable to allow that 'user' to log in using windows authentication, then the only other route here would be to have an administrative account user both install localdb, and then sqlcmd (version 2012) and then;

 

create login localappuser with password="password", default_database=[master], default_language=[us_english], check_expiration=off, check_policy=off

 

exec sys.sp_addsrvrolemember @loginame="localappuser", @rolename="sysadmin"

 

go

 

(above could also be deployed as a script, albeit one that might need to be ran by the administrator)

 

the above sql essentially grants the standard 'user' full permissions within the realm of what one can do within localdb.  of course if one knew explicit priveleges to be granted, as opposed to giving the user 'sysadmin' priveleges - that can also be done.

 

what this does is change how the user will loginto localdb.  instead of logging in using windows authentication, this would allow them to get in using sql authentication (meaning in the connect string, one would use 'User Id=localappuser;Password=password;Persist Security Info=True;' (relative to the windows authentication connect string parameter 'Integrated Security=SSPI')


Monday, August 20, 2012 - 2:58:49 PM - Varun Read The Tip

I was struggling to connect to my local database after i installed SQL Server 20120 mngt studio and you post just did what I was expecting.

It saved me from getting mad.. You solved the issue i was trying to resolve after n number of times of reinstallation of mngt studio..

 

Thanks a lot

 

 


Thursday, August 23, 2012 - 7:04:04 AM - Bijan Read The Tip

Hi Aaron

Thank you for the instructions. I am very new to all this and got stuck at the beginning. Successfully completed the SQL 2012 express LocalDB installation, but having problems interacting with it using the command line.

C:\> SqlLocalDb info  gives the following error message:

SqlLoacalDb not recognized as an internal or ……..

I have window 7, office 2010 (32 bit) on a 64 machine and successfully followed all your instructions up to the error message.

Many thanks

 

 

 


Thursday, August 23, 2012 - 9:19:54 AM - Aaron Bertrand Read The Tip

Bijan, you need to find SQLLocalDB.exe on your system and make sure that you call it from its location, by either:

 

(a) using CD in the command window first 

(b) using C:\...path...\SQLLocalDB.exe in your command explicitly

(c) ensuring that the containing folder is part of your PATH environment variable


Thursday, September 06, 2012 - 3:14:44 AM - Vix Read The Tip

Nice stuff!

Quick question if anyone knows - I'm using the instance pipe name to connect which works however when I execute something like SELECT @@SERVERNAME I find that it returns a name with similar hex bits included - this is fine however I need to have a constant instance name instead of the different one (with it changing between restarts of the instance)...i.e. to use as something that can always be connected to from a config file or for storing the name within the database for use somewhere else.

Any ideas?


Thursday, September 06, 2012 - 9:42:49 AM - Aaron Bertrand Read The Tip

@Vix, you shouldn't have to continue using the instance pipe name to connect. Are you using an older driver that doesn't understand localdb? Can you describe what application requires the instance pipe name to be used?


Thursday, September 06, 2012 - 10:23:46 AM - Vix Read The Tip

Hi Aaron

Yeah we're connecting from .NET 2.0 applications still and we don't really have the option to upgrade just yet. I've tried connecting to the instance using the methods described but perhaps I need to share the instance first or something? I'm guessing the pipe name is the only one that is unique/different everytime however the bit that scared me is that when you execute select @@ServerName or select ServerProperty('ServerName') then it returns the machine name together with the strange instanced hex bit:

MYCOMPUTERNAME\LOCALDB#8512366D
The named pipe for the above connection was as follows:
np:\\.\pipe\LOCALDB#8512366D\tsql\query

Surely if (LocalDB)\TestInstance worked then it should also return that as the name from @@ServerName?

Cheers,
Vix

 


Monday, October 01, 2012 - 10:36:03 AM - Jon Read The Tip

Hello, I have a problem in that my Dell computer mis-reports the sector size of my new Advanced Format Harddrive as having a 3072 sector size, which causes LocalDB to choke. I tried installing a secondary drive and moving everything over to that, but there seems to be no way to convince LocalDB to accept that; I even see in your screenshots above that the "feature directories" are greyed out, just as they were in my install. How can I move LocalDB over to that other drive so that I can get it working on my developer computer? I'd hate to have to fall back to a virtual machine just because of that one annoying aspect of the installer. Isn't there some way to move the master db over to another drive or something?


Thursday, October 11, 2012 - 10:40:56 AM - Maheshraj Read The Tip

Hi Aaron , 

This was a great work by you, for so may days i was striving for a localdb , and u have made it real .

I have some problems while retsoring databases in my local. and following are the details while restoring the database into my lcoal.

I Installed LocalDb in my system and named the instance as (localdb)\MyInstance , i am trying to restore a database into the Localdb\MyInstance , but i am getting the error as "Property MasterDBPath is not available for Information 'Microsoft.SqlServer.Management.Smo.Information'. This property may not exist for this object, or may not be retrievable due to insufficient access rights.  (SqlManagerUI)". 

Please help me in restoring the database into my instance.

 


Thursday, October 11, 2012 - 7:02:02 PM - Aaron Bertrand Read The Tip

Maheshraj, this is a bug I reported a while back:

http://connect.microsoft.com/SQLServer/feedback/details/726826/management-studio-exception-for-localdb-instance

The key is to simply use a RESTORE DATABASE command in a query window instead of trying to do it through the Management Studio wizard.


Friday, October 12, 2012 - 5:52:49 AM - Maheshraj Read The Tip

Hi Aaron ,Thanks for your valuable help, i followed the Key suggested by you , I restored the database into my (localdb\MyInstance) using Query window,

 but i got an another Big problem .

i have installed a product build in my system and tried to run the schema using database configuration wizard , i selected the Dataserver as (localdb)\MyInstance and authentication as windows authentication , and clicked on next button .

I am getting the error as "a network -related or instance-specific error occurred while establishing a connection to sql server . The server was not found or was not accessible . verify that the instance name is correct and that sql server is configured to allow remote conections .(provider : sql network interfaces , error :26 -error locating server/instance specified) in server localdb\myinstance"

 

After that i went into sql server configuration manager and checked the SQL Server Services , but there are no item in the services.

Please help me in running the schema.


Friday, October 12, 2012 - 3:41:26 PM - Aaron Bertrand Read The Tip

Maheshraj sorry, but from where I'm sitting I'm going to have a very hard time troubleshooting your issue. You need to make sure the instance is started (it won't be listed in SQL Server Configuration Manager but you can get the list of instances using SqlLocaldb.exe info and then for any instance you can get details, including state, using SqlLocaldb.exe info "instance name").


Saturday, October 13, 2012 - 7:32:58 AM - Nitish Singh Read The Tip

can one add username and password in the connection string for localdb...I have tried doing that but some kind of error is there...i have checked and re-checked my userID and password...But nothing is happening....Can you guide me in right direction

Thankyou

 


Saturday, October 13, 2012 - 7:31:07 PM - Aaron Bertrand Read The Tip

Nitish, I don't know how to fix "some kind of error" - can you please post your question (including the actual error message) to th Q & A section where I'm sure someone will be able to help you:

 

http://sqlserverquestions.mssqltips.com/questionlist.asp


Wednesday, November 28, 2012 - 10:59:55 PM - Brett Baggott Read The Tip

This post provides great information, presented expertly, and I admire the effort you've gone to in your comments section to help others work with and get value from the new LocalDb. However, and someone's got to say it, aren't we getting beyond the scope of LocalDb? I'm not trying to be an elitest or purist or anything but LocalDb isn't really meant to be a SQLite competitor is it? I'm not just trying to be a jerk here. I really want to know your opinion on if you think LocalDb will become an alternative to SQLite and other such low impact Sql providers (even though I still might argue it's not designed to be)?


Thursday, November 29, 2012 - 11:06:26 AM - Aaron Bertrand Read The Tip

Brett, I suppose that deep down, aren't all products developed to fill a void and/or be better than their competitors? That said, I don't think SQLite users are the target audience in this case, even though some may find LocalDb more appealing than what they're using now (and full-on SQL Server Express / Developer).

LocalDb was developed - at least as far as I have been told - for two main purposes:

(1) to make a SQL Server developer's life easier. No need to install, configure and manage an instance of SQL Server. Get the runtime when you need it, without the overhead of a service when you don't.

(2) to make a workplace more secure. No need to manage security or remote connections, and no worry that an instance of SQL Server is forgotten about but running forever, unpatched, and exposed to who knows what over time.

While it's technically *supported* in production, that isn't its focus and it is not intending to unseat any of the other players there. Again, AFAIK. I don't work for Microsoft and so I don't have insight into all of their reasoning or intentions.


Thursday, November 29, 2012 - 1:05:21 PM - Brett Baggott Read The Tip

Well, that was my point, it's not really meant for production.


Thursday, November 29, 2012 - 3:48:28 PM - Aaron Bertrand Read The Tip

Brett true, but maybe for different reasons than you think:

http://stackoverflow.com/questions/13571331/is-it-normal-to-use-localdb-in-production


Monday, December 03, 2012 - 6:52:17 AM - Amanuel Amente Read The Tip

I created the "foo" database with "bar" table that have column called "ID" of data type int. My questions is how can I enter the actual table value? I want you to show me how to enter values 10, 30, ... into the actual data table dbo.bar. 


Monday, December 03, 2012 - 7:32:44 AM - Jeremy Kadlec Read The Tip

Amanuel,

I would check out this tutorial - http://www.mssqltips.com/sqlservertutorial/2514/sql-server-insert-command/.

Thank you,
Jeremy Kadlec


Tuesday, December 11, 2012 - 7:46:10 AM - Mohankumar Read The Tip

Thanks a lot.

Much useful article.


Thursday, December 20, 2012 - 11:28:14 AM - Vitor Read The Tip
Nice and comprehensive article, thanks Mr. Bertrand.

Thursday, December 20, 2012 - 3:37:31 PM - Colin Read The Tip

Hi Aaron Thank you for a very well presented lesson on creating an instant. I am new to sql and have thus far only developed MSaccess and Visual basic desk top applications. I trying to move my back end tables to sql Server. Honestly speaking i simply did not understand that you must create and instance. I assumed sql server would automatically create one on installion. For days i could not access SQL. A hearty thank you for showing me the light. I intend to test my application locally and then export the sql database to a remote online server. May i ask if you could clarify the basic steps to achieve this. Thanks again


Thursday, December 20, 2012 - 4:50:00 PM - Aaron Bertrand Read The Tip

Colin I think the easiest way would be to simply create a backup of your local database and send that to the remote server (I assume it's a web hosting company of some sort) for them to restore.


Friday, December 21, 2012 - 3:00:23 AM - Colin Read The Tip

Hi Aaron, Thanks for the prompt reply. I have a MSACESS backend (ACCDB). Do you mean i should import into SQL server, backup and restore on the remote web hosting company and relink?  Also what is the best way to import my database into my sql instant?  Thanks again!


Friday, December 21, 2012 - 7:52:16 AM - Aaron Bertrand Read The Tip

Sorry Colin, I haven't used MSAccess since Access 97, so I'm the last person you want to ask about that. :-)


Friday, December 21, 2012 - 1:17:26 PM - Vitor Read The Tip
I have tried this today, but I keep getting access denied when I try to use sqlcmd with my instance to create a DB. Management Studio gives a "file activation error" when trying to create the database. I have permissions to read and write to "C:\Users\NAME\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\MyInstance", why is this happening? I have no prior experience with DBs, this is for a college assignment... Thanks!

Friday, December 21, 2012 - 1:35:31 PM - Vitor Read The Tip
Nevermind, turns out I had a previous sqlcmd even though it's the very first time I'm using SQL Server. It appears to install a lot of 2008 stuff for some reason.

Monday, March 04, 2013 - 8:07:58 AM - AlexeyVG Read The Tip

Can I use SQL Express LocalDB for commercial hosting services? According to the EULA - can not.

This restriction was in SQL Express 2005 before SP1.

And now back in 2012...


Tuesday, March 05, 2013 - 7:20:54 AM - Soma Tekumalla Read The Tip

Very nice article - Glad I read it. I could NOT connect to my LocalDB instance using SQL Server 2005 Management Studio but was able to do so using SQL Servere 2012 Express. 


Thursday, April 11, 2013 - 11:23:06 AM - Jacob Krimbel Read The Tip

FYI, the default instance does not work on 32 bit Windows 8.  Easy steps to reproduce:

1.)  Install localdb on a Windows 8 x86 box

2.)  Connect to (localdb)\v11.0 using any application that can make a connection, such as SSMS.

3.)  Observe error message.

Only occurs with the default instance and only on Windows 8 x86.  Does not occur with named instances.


Thursday, April 11, 2013 - 1:32:34 PM - Aaron Bertrand Read The Tip

Thanks Jacob. Oh, and Windows 8 really still ships in x86? Why would anyone use that? :-)


Monday, May 06, 2013 - 7:52:53 AM - Aizaz Ahmad Khan Durrani Read The Tip

i have one problem in connecting to server so due to ur article my problem is solved .

 

thanks


Friday, July 05, 2013 - 10:34:34 AM - deepak gupta Read The Tip

Dear Aaron,

I have two Servers for sql One is live and other is backup.

I created the autobackup sequences but want to do mirroring databases of both the servers in sql2012.

I need your kind help in getting this done.

warm regards.

deepak gupta


Thursday, August 22, 2013 - 12:06:55 PM - Den Read The Tip

So... This is probably a stupid question.. but how do I make my server visible to Microsoft Access 2007? I went to create an ADP file with an existing server, but it doesn't show on the pulldown.  


Friday, January 10, 2014 - 5:54:11 PM - OKie eko Wardoyo Read The Tip

I'm new to sql server express.

my computer is Windows 8.1 64 bit, i have visual studio 2013 installed on my pc.

I tried to download what i need here http://www.microsoft.com/en-us/download/details.aspx?id=29062

First, i donwload and install ENU\x64\SQLEXPR_x64_ENU.exe then installed it, SUCCESS.

then, i donwload ENU\x64\SqlLocalDB.MSI and tried to installed. WOW, it said like below:

"there is a problem with this windows installer package. A DLL required for this installation to complete could not be run. Contact your suport personal or package vendor."

I don't know what it means.

thanks.


Friday, February 14, 2014 - 8:06:58 AM - Joel Read The Tip

You Rock!  

This saved me an 2hrs of searching time


Monday, February 24, 2014 - 9:59:34 AM - cf_phil Read The Tip

AAAAAAAAAAAAAH!!! Sweet RELIEF!!! AN ANSWER!!!!

My local engine was installed, but I couldnt login, or anything and was beginning to think I was going insane.

Turns out I needed to create a new instance on by local engine with the CMD.

Thanks very much for this article!

 

Today is now no longer a *complete* waste of time - just perhaps only 90% a waste of time now.

 


Monday, March 03, 2014 - 12:07:12 PM - Ashenafi Read The Tip

You saved my day. Thanks buddy!

 


Thursday, March 20, 2014 - 9:08:19 AM - KUMAR UTKARSH Read The Tip

Hello all,

 

I am very new to SQL server 2012, I have a sql file named "Ranked_Key_Search.sql" . I double clicked it to open but some one said that I need to add my database after opening that particular file. Will you please explain me te procedure to add the database by using "restore databse" commend by right clicking.
please reply soon, its very urgent 


Saturday, August 30, 2014 - 6:40:43 PM - Luiz Arbore Read The Tip

Hello,

I'm trying to install a software that starts by installing sql server 2012 express localdb when it reaches the updating part of installation it's interrupted by ""key not valid for use in specified state "" consequently cannot install the software. I have windows Vista 64 SP 2 all up to date. please help. Thank you


Monday, September 01, 2014 - 8:13:21 AM - Aaron Bertrand Read The Tip

Sorry Luiz, I've never seen that one, and I doubt the key-related message has anything to do with LocalDb. I am suggest you bring it up with the makers of the software package you're trying to install.



Post a Comment or Question

Keep it clean and stay on the subject or we may delete your comment.
Your email address is not published. Required fields are marked with an asterisk (*)

*Name   *Email Notify for updates



Comments
Get free SQL tips:

*Enter Code refresh code


 
Sponsor Information







Copyright (c) 2006-2014 Edgewood Solutions, LLC All rights reserved
privacy | disclaimer | copyright | advertise | about
authors | contribute | feedback | giveaways | free t-shirt | user groups | community | events | first timer?
Some names and products listed are the registered trademarks of their respective owners.