1 00:00:00,930 --> 00:00:06,630 ‫In this chapter, we are going to work with databases and therefore we need the right tools to do so. 2 00:00:06,660 --> 00:00:09,250 ‫Visual Studio by itself is not going to be enough. 3 00:00:09,270 --> 00:00:13,080 ‫We will need to use Microsoft SQL Server. 4 00:00:13,110 --> 00:00:20,100 ‫So let's go ahead and search for SQL Server, Windows and Google and then choose the one from your country 5 00:00:20,100 --> 00:00:24,180 ‫or your language, or at least the language that you have installed on your system. 6 00:00:24,210 --> 00:00:30,300 ‫In my case, I have an English system installed or an English windows, so I will need a SQL server 7 00:00:30,720 --> 00:00:38,460 ‫with the English version here n minus us here you can simply download the developer edition, so click 8 00:00:38,460 --> 00:00:42,630 ‫here on download now and simply download the exe file. 9 00:00:44,730 --> 00:00:47,880 ‫Once you open up the Excel file, you'll find this window here. 10 00:00:47,880 --> 00:00:55,320 ‫Select an installation type and either just use custom here, then you need to specify the location 11 00:00:55,320 --> 00:00:59,280 ‫onto which you want to install your SQL Server. 12 00:00:59,730 --> 00:01:02,070 ‫And I'm just going to press install. 13 00:01:04,800 --> 00:01:10,710 ‫And that will take quite a while because it needs to download all the files and then it will finally 14 00:01:10,710 --> 00:01:11,820 ‫do the installation. 15 00:01:14,100 --> 00:01:18,540 ‫Once that is done, the SQL Server Installation Center will open up. 16 00:01:18,540 --> 00:01:21,870 ‫And if that doesn't happen, then you simply need to open it up. 17 00:01:23,220 --> 00:01:30,840 ‫If you wonder where to find it, simply open up the folder to onto which you have installed your SQL 18 00:01:30,840 --> 00:01:31,530 ‫Server. 19 00:01:31,560 --> 00:01:37,080 ‫There you'll find the developer and you folder and there you'll find the setup exa. 20 00:01:37,350 --> 00:01:41,670 ‫Once you open it up, you will open this window here. 21 00:01:41,670 --> 00:01:45,570 ‫This server SQL or SQL Server Installation Center. 22 00:01:46,470 --> 00:01:52,770 ‫Once you're here, you need to press the new SQL or SQL Server standalone installation or add features 23 00:01:52,770 --> 00:01:54,660 ‫to an existing installation. 24 00:01:57,620 --> 00:02:01,280 ‫And here you see the different rules that are required in my case. 25 00:02:01,490 --> 00:02:03,600 ‫It needs to restart my computer. 26 00:02:03,620 --> 00:02:05,570 ‫So in my case, it failed. 27 00:02:05,690 --> 00:02:12,570 ‫What I need to do now is, of course, to restart my computer and then I'll be back in your case. 28 00:02:12,590 --> 00:02:15,740 ‫A restart might not be required. 29 00:02:16,160 --> 00:02:18,890 ‫Next, we are the Microsoft update. 30 00:02:18,890 --> 00:02:21,200 ‫Well, it can check for updates. 31 00:02:21,200 --> 00:02:22,920 ‫I will not check that mark. 32 00:02:22,940 --> 00:02:24,320 ‫Then I click next. 33 00:02:25,690 --> 00:02:31,070 ‫And it's going to install the set up files once all of that is done. 34 00:02:31,090 --> 00:02:36,430 ‫We can see that there is only one warning and that's the Windows firewall, but we can ignore that. 35 00:02:36,880 --> 00:02:46,420 ‫Then we click next again and in here we can go ahead and perform a new installation of SQL Server 2017. 36 00:02:47,320 --> 00:02:49,970 ‫As you can see, I have an installation here already. 37 00:02:49,990 --> 00:02:53,050 ‫Now I'm going to perform a new one I click on next. 38 00:02:53,350 --> 00:02:59,290 ‫Here you can specify a free edition or you can go ahead and check another one and enter the product 39 00:02:59,290 --> 00:03:00,660 ‫key if you have bought one. 40 00:03:00,670 --> 00:03:04,510 ‫But the developer edition is totally fine as we are using the free edition. 41 00:03:04,930 --> 00:03:12,460 ‫Then click next and here you need to read through and accept the license terms and I'm going to accept 42 00:03:12,460 --> 00:03:14,140 ‫them and click next again. 43 00:03:16,000 --> 00:03:19,030 ‫Next, you can decide which features you would like to install. 44 00:03:19,030 --> 00:03:25,630 ‫And there are plenty of instance features, shared features and redistributable features that you can 45 00:03:25,630 --> 00:03:26,160 ‫install. 46 00:03:26,170 --> 00:03:31,750 ‫The one that's interesting for us is this database engine services because that's the one that we are 47 00:03:31,750 --> 00:03:33,460 ‫actually going to require. 48 00:03:34,270 --> 00:03:40,780 ‫Once you have that checked, click next again and now you can name an instance. 49 00:03:40,780 --> 00:03:46,660 ‫So you can go ahead and create a named instance or you can use a default instance which will get an 50 00:03:46,930 --> 00:03:49,840 ‫instance ID of RMS SQL Server. 51 00:03:49,840 --> 00:03:53,080 ‫But I'm just going to create a new named instance. 52 00:03:54,160 --> 00:03:57,550 ‫I'm going to call it Pan Tutorials, 53 00:04:00,770 --> 00:04:01,540 ‫SQL. 54 00:04:02,370 --> 00:04:04,590 ‫But that name down, you might need it later on. 55 00:04:04,890 --> 00:04:09,630 ‫And you also want to change the instance ID once you click on it. 56 00:04:09,660 --> 00:04:12,060 ‫It will be named like the named instance. 57 00:04:12,570 --> 00:04:14,010 ‫Then we click next again. 58 00:04:17,240 --> 00:04:18,950 ‫You can simply click next again. 59 00:04:20,720 --> 00:04:28,100 ‫And we are at the database engine configuration where you can enter the note authentication mode. 60 00:04:28,100 --> 00:04:33,830 ‫And we're going to use the mixed mode here, which is the SQL Server authentication and the Windows 61 00:04:33,830 --> 00:04:34,970 ‫authentication. 62 00:04:34,970 --> 00:04:42,980 ‫So I'm going to enter a password and you should also enter your password and remember what that was. 63 00:04:44,930 --> 00:04:47,480 ‫Then press add current user. 64 00:04:49,720 --> 00:04:52,000 ‫And that will take a little while. 65 00:04:52,360 --> 00:04:53,350 ‫And there we are. 66 00:04:53,380 --> 00:04:59,590 ‫So as you can see, this is the name of my computer and then I can go ahead and click next again. 67 00:05:02,030 --> 00:05:08,240 ‫Once you're here, you can simply go ahead and click on install and that will go ahead and do all the 68 00:05:08,240 --> 00:05:09,530 ‫installation process. 69 00:05:12,790 --> 00:05:19,210 ‫Once that is done, you will find the install successful details here and then all is good so you can 70 00:05:19,210 --> 00:05:20,650 ‫go ahead and close that. 71 00:05:20,680 --> 00:05:28,840 ‫Now you need to install the SQL Server management tools, so simply press on that link here and then 72 00:05:28,840 --> 00:05:37,150 ‫this page comes up and you need to install the SQL Server Management Studio and in my case it's 17.6. 73 00:05:37,150 --> 00:05:45,160 ‫So I'm going to select that and download the S RMS setup exa and if you want to make sure that you get 74 00:05:45,160 --> 00:05:51,850 ‫the right version here, you can find a SQL Server management studio with the right country code. 75 00:05:51,850 --> 00:05:57,580 ‫So in my case, I need to install the English one and I'm going to save that. 76 00:06:02,320 --> 00:06:06,570 ‫And once a year you can simply press the install key and or the button. 77 00:06:06,580 --> 00:06:12,370 ‫In my case I only have the repair button here, so I'm just going to press on that just for you to see 78 00:06:12,370 --> 00:06:13,150 ‫how it looks. 79 00:06:13,150 --> 00:06:19,750 ‫So in there you can see that this is Microsoft SQL Server Management Tool and it will simply go ahead 80 00:06:19,750 --> 00:06:25,330 ‫and install the packages and install everything else that is required for us to go on. 81 00:06:26,920 --> 00:06:30,070 ‫And in my case, another restart is required. 82 00:06:30,070 --> 00:06:35,680 ‫It can be that in your case it's not required, but I'm just going to press restart it once again and 83 00:06:35,680 --> 00:06:38,980 ‫restart my machine and I'll be back in a second. 84 00:06:39,640 --> 00:06:47,680 ‫Now that it's installed, you can simply press the Windows key and enter SQL and then you'll find Microsoft 85 00:06:47,680 --> 00:06:50,470 ‫SQL Server Management Studio. 86 00:06:53,440 --> 00:07:01,580 ‫So there we are and we need to connect to a server and thereby we can either choose what is given here. 87 00:07:01,600 --> 00:07:06,490 ‫In my case, there are two servers given which are the same, and I can even browse for more. 88 00:07:06,520 --> 00:07:13,870 ‫Therefore I open database engine and here I find the one that I have set up which was trials SQL. 89 00:07:14,350 --> 00:07:15,960 ‫And I'm going to use that. 90 00:07:15,970 --> 00:07:18,190 ‫I'm going to open it up server name here. 91 00:07:18,190 --> 00:07:25,180 ‫I'm going to choose the SQL Server authentication, which we set up ourselves and as the login it is 92 00:07:25,180 --> 00:07:30,000 ‫as a standing for server admin and the password was the one that we have entered. 93 00:07:30,010 --> 00:07:32,500 ‫So I'm going to enter that here. 94 00:07:32,620 --> 00:07:37,090 ‫I'm going to set remember password and connect to the server. 95 00:07:37,570 --> 00:07:42,430 ‫Now that I'm connected to the server, we can go ahead and open up Visual Studio. 96 00:07:42,430 --> 00:07:48,640 ‫So I'm going to open up Visual Studio right now that we are, and I'll connect to Visual Studio on the 97 00:07:48,640 --> 00:07:53,320 ‫left hand side I can see the server explorer, otherwise you can also open it up from here. 98 00:07:53,320 --> 00:07:54,730 ‫View Server Explorer. 99 00:07:54,730 --> 00:07:58,660 ‫So control alt as would be the shortcut. 100 00:07:59,650 --> 00:08:08,950 ‫And we are we're connected to a database that I have set up before and I can create a new database connection. 101 00:08:09,580 --> 00:08:15,310 ‫So here add connection and I choose Microsoft SQL Server. 102 00:08:17,020 --> 00:08:21,020 ‫Next I continue and I select server name. 103 00:08:21,040 --> 00:08:28,690 ‫In my case, it doesn't show anything and you can simply open up your Microsoft SQL Server Management 104 00:08:28,690 --> 00:08:32,860 ‫Studio once again and take that name here. 105 00:08:34,470 --> 00:08:37,530 ‫So I'm going to go to properties here. 106 00:08:39,770 --> 00:08:43,550 ‫And copy the name from here. 107 00:08:44,360 --> 00:08:47,120 ‫Now we can close that and use the name here. 108 00:08:47,210 --> 00:08:53,870 ‫I choose SQL Server authentication again as a was the username and then I had my password in here. 109 00:08:54,620 --> 00:09:02,200 ‫I'm going to save my password and I will select or enter a database name which I'm going to create myself 110 00:09:02,210 --> 00:09:06,740 ‫and I'm going to call that one pun, you Torrijos. 111 00:09:06,740 --> 00:09:15,440 ‫DB And then if your database was not there yet, or if it doesn't exist yet, you want to create it. 112 00:09:15,440 --> 00:09:17,210 ‫So would you like to attempt to create it? 113 00:09:17,210 --> 00:09:20,310 ‫I'm going to say yes, and there we are. 114 00:09:20,330 --> 00:09:22,130 ‫It has created my connection. 115 00:09:22,130 --> 00:09:24,170 ‫And as you can see, I had a connection before. 116 00:09:24,170 --> 00:09:29,390 ‫So I'm going to delete that or actually I'm going to leave it open for now. 117 00:09:29,390 --> 00:09:30,680 ‫I'm going to delete it later. 118 00:09:30,680 --> 00:09:34,760 ‫But as you can see, we have a database here now. 119 00:09:34,760 --> 00:09:42,160 ‫We have a data connection and a database which is our DB dot db file database object. 120 00:09:42,170 --> 00:09:47,330 ‫As you can see, if I open up tables, there is nothing there yet, but for now we have everything set 121 00:09:47,330 --> 00:09:52,520 ‫up so we can go ahead and start with our database projects in the next video. 122 00:09:52,520 --> 00:09:53,690 ‫So see you there.