When it comes to SQL Server for personal use – (i.e. training, education) Microsoft offers two options:
- SQL Server Express: This option is free, but is surprisingly robust. This is the version I cut my teeth on.
- SQL Server Developer Edition – which you can find online at around the $60.00 price point. This edition is worth the money as it comes with everything (SSIS, SSRS, etc.) Unfortunately you will need to purchase from a 3rd party vendor because as of the time of this writing, Microsoft is not currently selling it.
For this tutorial, we will focus on Express:
Here is the link for SQL Server Express: Download Link
The screen below explains the options available. You will want – at minimum – to install SQL Server Express with Tools. I would recommend SQL Server Express with Advanced Services.
Select the download arrow my red arrow is pointing to and you will be asked to sign in with your Microsoft Account. (If you don’t have one, do not worry, they are free – sign up for it).
On the next screen, choose your version and language. Make sure you choose 64 or 32bit. If you don’t know what version Windows you are running. Go to your Control Panel > Admin Tools > System Configuration You will find your system version there.
Once the file downloads, just run it like a regular MSI. The only thing you really may not have seen before is asking for authentication method. I always go with Mixed Mode (just make sure to remember the SA password you put in).
If you are having trouble, here is a good You Tube Tutorial for a step by step installation: Link to Video
Okay, now we have SQL Server installed, let’s use it.
Starting SQL Server Management Studio
SQL Server Management Studio is how you will interact with SQL Server.
To open it up, hit Windows Key+R. In the run box type SSMS.
Since you are trying to connect to the SQL Server you just installed on your computer, enter localhost as Server name. Choose Windows Authentication and hit connect.
Let’s Make a Database
Once SQL Server Management Studio opens, go to the Object Explorer and right click Databases > New Database
Let us name the new database SQLIntro and hit okay. Don’t worry about other options at this point.
From the top bar, select New Query
Copy and Paste the following script into the Query window that just opened up. Don’t worry about the code at this point. Just know:
- Use SQLIntro – tells us to use the database we just created
- Create table — we are creating a table called FirstTable with 2 columns Name and Age
- We are inserting data (names and ages of 4 people) into our new table
Copy the script below:
Create table FirstTable
Insert into FirstTable (Name, Age)
values (‘Ben’, 40), (‘Chris’, 45), (‘Patrick’, 32), (‘Jordan’, 18)
After you paste the data, hit Execute!
Let’s See Our Data
Go to Object Explorer:
- Databases — note you will not have as many databases as you see here. This is my SQL Server I have been working with for the past 3 years.
- Right Click dbo.FirstTable
- Select Top 1000 Rows
And there you have it, the contents of your first table in your first SQL Server Database
If you enjoyed this lesson, click LIKE below, or even better, leave me a COMMENT.
Follow this link for more SQL content: SQL