Marius Gheorghe

Building software : make it work, make it good, make it fast

Lightweight tools and workflow with SqlServer

SqlServer database server and associated tools become more and more heavy and cumbersome with each new version. It's a bit ridiculous to install 2GB of stuff just so you can develop something on your local machine. Fortunately, there are lightweight alternatives. Here's what i have ended up using for this scenario:

- Install SqlServer 2014 LocalDb. It's available here (linked directly the x64 version). This is the SqlServer version created especially for this scenario.

- after installing it, you can connect directly to this server using sqllocaldb.exe (located in C:\Program Files\Microsoft SQL Server\120\Tools\Binn). The notable CLI switches are : -start and -stop (to start/stop the default server) . The entire list of cli switches is available at here.

- create your database using the default server instance (recommended). By default the database files are stucked in your UserProfile folder but you can override this to put the db file wherever you want:
 create database foo on (name='foo', filename='c:\DBs\foo.mdf')

- if you need a lightweight GUI alternative to Management Studio i recommand Query Plus Ex . You can connect to the default LocalDb server using the server name (localdb)\MSSQLLocalDB

- if you prefer CLI to the GUI tool, you can use sqlcmd.exe (which sadly is missing from the LocalDB install). You'll have to install SqlServer Express edition to get sqlcmd.exe

- update your app connection string to point to the new server and off you go.