SQL Server on Linux – get started

I want to get in a good habit of recording some simple tutorials from time to time using the English language, so here comes the first one about my experience with running the SQL Server on Linux. Enjoy!


 

The first thing you need to do is to open the following website and follow the selected installation guide. For example, I’m using the ElementaryOS so I chose the Ubuntu guide. Also, make sure you’ll install the SQL Server Tools.

Eventually, you can open the Connect and Query tab and run the following command in your terminal:

You can execute a very simple query in order to make sure that everything works properly.

From that point, you can go scroll down where I describe how to create a simple C# application, but if you’re using Visual Studio Code, most likely you will find the mssql extension to be the interesting tool.

Here you can find a quite comprehensive guide but as I shown in the video above it’s very easy to connect to the SQL Server instance using VS Code – just hit CTRL+SHIFT+P, create a new profile, type in “localhost” as the instance name, provide credentials and you’ll be connected to the SQL Server. From that point, you can execute a query by hitting the CTRL+SHIFT+E combination. There is also a lot of the useful SQL snippets – just start typing sql in the new SQL file created within a VS Code and you’ll see them popping out of nowhere.

And finally, in order to connect to the SQL Server, you can use a library like Dapper, just create a new C# .NET Core application, and type in the following code:

You can download this very simple application by clicking here.

4 Comments SQL Server on Linux – get started

  1. Pingback: SQL Server on Linux – get started - How to Code .NET

  2. Pingback: Dew Drop - January 30, 2017 (#2410) - Morning Dew

  3. Pingback: ASP.NET Core 12 samples | Piotr Gankiewicz

  4. Pingback: 十二个 ASP.NET Core 例子 | 赵榕笔记

Leave A Comment

Your email address will not be published. Required fields are marked *