Welcome to this lecture.
My name is Yannick and I'm Dennis Co-instructor.
So some time has passed and, well, we needed to make an update on this lecture.
So here it is Right in this lecture we will take a look at how to set up an SQL Server instance and
how to set up a connection in Visual Studio.
In the old version of this lecture, we have used Microsoft SQL Server 2017, but that one is legacy.
And now we start using Microsoft SQL Server 2019 Express.
So please go ahead.
If you follow along with this video and search for SQL Server 2019 Express afterwards, click on the
first link if you want to Google it right, But you can also search at the Microsoft page.
Scroll down until you can find this window right here.
Select your language.
I will pick English for sure and then click on download and start downloading your SQL Server 2019 Express
Installer.
Once it got downloaded, open it up and let's start installing the instance.
Let's pick custom right here.
Now pick any folder for the installation and then hit install.
Well, let's give it some time.
Now, once done, you will come to the SQL Server Installation Center where we can well set up and create
a new SQL Server standalone installation.
So pick the first one.
Let's click on that.
Another window will open up where you can start setting up the SQL Server.
So let's just hit next right here.
Let's give it a second to load all of that.
Let's hit next until you come to this window right here or well, this screen where it says like perform
a new installation of SQL Server or add something to an existing installation.
Now for sure, I already have Microsoft SQL Server installed quite, quite often, right?
Because we create a lot of tutorials.
However, we want to perform again a new installation of SQL Server 2019.
So select the first one and then hit next.
Now we want to accept the license and terms hit next again.
Now we can select some features.
Now I want to give you a good overview of what I'm installing right here.
Will install the database engine service and I untick the machine learning services and languages.
So untick that one that saves a lot of space.
Now we keep SQL server replication ticked.
Now we got the full text and semantic extractions ticked.
And here for the shared features you can see that everything was ticked right here, right?
So just for you to know what exactly I'm installing now, let's hit next again.
Now we can pick the default instance and we will get the MySQL server name as our default instance name.
Or we can choose our own name and I will copy that just from the last video or not from the last video,
but from the older version of this video where Dennis put in Pantagruel's
SQL so that if you see this in one of the next videos, you know why I picked that name right here.
Okay.
So and then for the instance ID, we can now see that it got updated and it says Pantagruel's SQL then
hit next again, give it a moment to load.
That might take some time.
Now select the SQL Server database engine and hit next one more time.
Now here we can set up our authentication mode.
We could use the Windows authentication mode, but let's pick the mixed mode so that we can set up our
own account and our own password.
So go ahead, write down the password and you should remember it so that you are able to log in later
on.
For now, I will just take one, two, three, four, five, six.
Please go ahead and pick a more complicated password once you create applications well for rearward
and production.
Right?
So you don't want to pick such a weak password.
But just for the sake of this video, I will pick such an easy one.
Now I want to click on Add Current User and you can see that's basically the name of my well computer
user, right?
And chances are that you already had that selected.
So just make sure that this field is not empty.
Right now.
Next up, click on Next.
And finally, you should come to this screen which says Complete your SQL Server 2019 installation completed
successfully with product updates.
There we go.
And now everything is installed successfully and we can hit close.
Now we have installed an instance of our SQL Server, but if we want to see and visually take a look
at our databases and all of its tables and entries and all of that and execute some SQL, we should
install a tool for that which is called SQL Server Management Studio.
So let me repeat that again.
Right now we have installed the SQL Server.
That one does not contain any graphical user interface.
Okay.
But if you want to have a program to manage all of that using a GUI, then you want to install the SQL
Server Management Studio and therefore simply click on that link right here.
So this is another program.
All right, install SQL Server management tools.
It just opened another page on my second screen.
I'll just brought that here and you can see download SQL Server Management Studio.
So you simply click on free download for SQL Server Management Studio.
You download that and you go ahead and install it and you don't have to pay attention on anything.
Simply go ahead and install that program and afterwards open it up by searching for SQL Server Management
Studio or SMS at the bottom left corner.
So as you can see, if I search for SSMS at Windows, so in my Explorer you can see that it shows Microsoft
SQL Server Management Studio 18.
So you want to go ahead and open that up Now after installing Microsoft SQL Server Management Studio
and opening up, it should look something like this.
You should have that program and here you have a connect to server window.
Now simply maybe you can already see server name prefilled.
If not, just open up that arrow, click on Browse for more open up database engine and then search
for your instance name that we set for our SQL Server instance, which was PAN Tutorials SQL in my case.
Now pick that one hit.
Okay, then click on authentication and now pick SQL Server authentication.
That's what we have configured right down SA for server admin, that's the default one.
And your own password which you have set.
For me it was one, two, three, four, five, six.
Now let me hit connect and you can see that we are now connected to our SQL Server instance.
You can see that on the left side.
You can see databases here.
Right now, we for sure haven't set up any database yet, so we can just see the default one system
databases, right?
But well, once we set up a database, it will show right here.
So SQL Server Management Studio is a pretty handy tool if you want to perform some SQL queries.
If you want to take a look at your database in a visual way and all of that.
Right now, let's take a look at Visual Studio and how we can set up a connection to our database from
the Visual Studio Server Explorer.
So here in Visual Studio right now, I'm using version 2019, but that should work for any Visual Studio
version.
You can find the server explorer on the left side.
If you cannot see it, you can click on View and open up the server explorer right here and also pay
attention on the SQL Server Object Explorer, which you can also use to create a connection to an SQL
Server or to set up a new database.
But for now we stick with the server Explorer, right?
So click on that.
And now right click on Data Connections right here, right click, and then create new SQL Server database.
Now, as I already said, we haven't set up a new database right now.
We have set up an SQL Server, but we have not set up an SQL database.
So let's just take a look right here at the server name.
Let's open up that dropdown and if you are lucky enough, you may find your server.
But in my case it didn't.
So I simply open up SQL Server Management Studio, right click on my SQL Server instance right here,
click on properties and here you can see the name of our server.
So our right click on that, copy it again, go back to Visual Studio, write down the server name here.
Use our SQL Server authentication one more time.
It's just like exactly the connection that we set up right here.
Right, Exactly the same credentials.
So I'll write down as a server admin, right?
And then one, two, three, four, five, six or whatever password you chose.
Then I want to save my password and I want to set a new database name now and I want to call it panel
DB.
You can for sure name it however you like, but that's the actual database.
Now let's hit.
Okay.
And that has just created our database.
You can see that here, right?
If I open it up, there are no tables and all of that, right?
It's just an empty database.
But it is here.
And if we now go to SQL Server Management Studio again, open it up.
Let me just close that server properties window.
There we go.
And if I right click on that to update it or just hit refresh right here and then open up databases,
you can now see our tutorials.
DB right here.
So indeed we set up an SQL Server instance connected to it and created a real SQL database from Visual
Studio.
Great.
So that's all we need to get started with our project.
So thanks for watching.