Blog Post

Starting LocalDB–#SQLNewBlogger

,

Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.

Lots of people have never worked with LocalDB, which is an in-process version of SQL Express. No service account, just a SQL Server instance running with your app. It’s a nice lightweight way to get SQL Server running quickly without a hassle.

This is a SQL Server Express version, but the bare bones for development. This post looks at how you can get this running.

This version of SQL is installed with SQL Express, and with Visual Studio. If you look in this path: C:Program FilesMicrosoft SQL Server150ToolsBinn, there is a SQLLocalDB.exe. You can see that here.

2022-03-03 09_08_00-Binn

This is my SQL Server 2016 version of LocalDB. I can start a new instance by calling this with the CREATE option. I can give this a name as well, as I might want to stat multiple instance for different apps. Here I’ll create an instance called app1.

SQLLocalDB create app1

I then call the same command, but use START instead of CREATE. You can see this reports as started from the CLI. I also add the INFO call to get status.

2022-03-03 09_10_35-C__Windows_System32_cmd.exe

Now I can connect. I use (LocalDB)app1 to connect:

2022-03-03 09_11_39-Connect to Database Engine

I see I’m connected to a version of LocalDB then:

2022-03-03 09_12_03-SQLQuery2.sql - (localdb)_app1.master (ARISTOTLE_Steve (70))_ - Microsoft SQL Se

Now it’s just an instance of SQL Server I can use.

 

SQL New Blogger

I needed to check something for a customer and realized I hadn’t started LocalDB in a long time, so I needed to check the docs. I spent 10 minutes putting this post together.

An easy type of post for any of you out there. Learn something, try something, write something.

Original post (opens in new tab)
View comments in original post (opens in new tab)

Rate

5 (1)

You rated this post out of 5. Change rating

Share

Share

Rate

5 (1)

You rated this post out of 5. Change rating