From the course: Microsoft SQL Server 2019 Essential Training

Management Studio first steps - SQL Server Tutorial

From the course: Microsoft SQL Server 2019 Essential Training

Start my 1-month free trial

Management Studio first steps

- [Instructor] So far, we've got the database engine for SQL Server installed, and we've installed our graphical front end for working with the server that's SQL Server Management Studio. So let's go ahead and log into the server and take a first look around. I'll come down here to my Start menu, and I previously pinned the icon here for SQL Server Management Studio. So go ahead and click on that to start it up. And the first time you start up Management Studio, you might get a little window here that goes through some final preparation steps to get the program up and running, but eventually, you'll be left with this Connect to Server window. For the server type, we have the option here of the database engine, which is what we're going to choose, or you can also connect to Analysis Services, Reporting Services, or Integration Services if you've installed those components. Let's go ahead and leave this on Database Engine for now. For the server name, the first time you log in, this is going to be blank. Go ahead and click on the dropdown menu over here on the far right-hand side, and we're going to click on Browse For More. This will allow me to find servers on my local computer with this tab, or I can use this tab over here that says Network Servers to find SQL Server instances on my network. I'm going to switch back over here to Local Services and then expand the folder here for Database Engine, and you should see the instance name that we installed in the last chapter. For me, it's the name of my computer, Windows 10 PC, followed by a backslash and then SQL Server 2019. We'll go ahead and select it and press OK, and that'll get populated into the Server Name field. Once we've successfully logged into the server, Management Studio is going to remember this name here, so we don't need to go through that process again and we can simply just choose it from this dropdown list. I'll also point out for the server name that instead of the name of the computer, we can specify the IP address of the computer or, if we're on a local machine like I am, we can use the word local host here, or I can just simply type in a single period character, that'll work as well. So those two options are available if you're on a local connection, and that just simply means that you have SQL Server Database Engine running on the same computer that you're running Management Studio on. I prefer to include the full computer name, so I'm going to go with that option. Next is our authentication option. Right now it's currently set to Windows Authentication. When we installed SQL Server, we added our current Windows user account as an administrator, so by choosing Windows authentication, we don't need to supply a username and password. You'll notice that these two boxes are grayed out here. And that's all the information that I need to supply in order to log into my server instance. Before I press the Connect button, there are some additional connection options by expanding this button here that says Options. This'll give you access to settings that you probably won't need to change, but depending on the peculiarities of your network, your IT administrators might need you to configure these network and connection settings here. Let's go ahead and collapse this again by clicking on the Options button once again. When everything's filled in here, go ahead and press the Connect button, and Management Studio will connect to your SQL Server instance, and we'll see some activity over here on the left-hand side of the screen. This panel is called the Object Explorer Window. This provides a tree view of all the contents of the SQL Server instance. So we have databases here, we have security items, and so on. At the top is a line that shows what instance that we're currently looking at. Here we have the name of my computer, followed by the backslash, the name of the instance, then inside of a parentheses we have the version of SQL Server that we're working with. And if I expand this window open just a little bit by clicking here and dragging to the right, we'll also see our current Windows login account information there. This is the user account that we've been granted permissions through. Management Studio will also allow you to connect to multiple SQL Server instances at the same time, and they'll just show up one on top of another here inside of this window. You can even connect to the same instance under different users. At the top of the window, there's two buttons that look like electrical plugs. Click on the one on the left, and that'll bring us back to the Connective Server window. This time, I'm going to connect to the same server name here, but I'm going to change the authentication mode from Windows Authentication to SQL Server Authentication. When we installed SQL Server, one of the options was to enable the System Administrator account. This account's login credentials are stored on the server itself, so we'll need to provide a username and password. If you remember, the login name is simply SA, and then we established the password when we installed SQL Server. If you've forgotten what password you chose, that's okay. We'll see how to reset it in an upcoming movie. Once you've got those two pieces of information put in, go ahead and press the Connect button again and you'll see a new version of the SQL Server instance down below. So now here, reviewing the database through the perspective of the SA account, and up above we're viewing the same server through the perspective of our current Windows account. In order to disconnect from an instance, go ahead and select the one you want to disconnect from. I'll choose the SA account version, and click on the plug icon with the red X on it. That'll remove its details from the Object Explorer window. So that's how you log into SQL Server through Management Studio. If you're using Windows authentication, it simply adopts the credentials of your current Windows account, or if you're using a SQL Server authentication account, you'll need to supply a username and password.

Contents