Lesson 1: Connecting to the Database Engine - SQL Server (2024)

  • Article

Applies to: Lesson 1: Connecting to the Database Engine - SQL Server (1) SQL Server

When you install the SQL Server Database Engine, the tools that are installed depend upon the edition and your setup choices. This lesson reviews the principal tools and shows how to connect and perform an essential function (authorizing more users).

This lesson contains the following tasks:

  • Tools for getting started
  • Connecting with Management Studio
  • Authorizing extra connections
  • The SQL Server Database Engine ships with various tools. This article describes the first tools you need and helps you select the right tool for the job. All tools can be accessed from the Start menu. Some tools, such as SQL Server Management Studio (SSMS), aren't installed by default. Select the tools you want as part of the client components during setup. For a complete description of the tools below, search for them in SQL Server Books Online. SQL Server Express contains only a subset of the tools.

Common tools

The following table describes some of the more common client tools.

Client toolTypeOperating system
SQL Server Management Studio (SSMS)GUIWindows
Azure Data StudioGUIWindows, macOS, Linux
bcpCLIWindows, macOS, Linux
sqlcmdCLIWindows, macOS, Linux

For this article, we are going to focus on connecting via SSMS. If you are interested in connecting via Azure Data Studio, see Quickstart: Use Azure Data Studio to connect and query SQL Server.

Sample database

This article requires the AdventureWorks2022 sample database, which you can download from the Microsoft SQL Server Samples and Community Projects home page.

SQL Server Management Studio (Windows only)

  • On current versions of Windows, on the Start page, type SSMS, and then select Microsoft SQL Server Management Studio.
  • When using older versions of Windows, on the Start menu, point to All Programs, point to Microsoft SQL Server, and then select SQL Server Management Studio.

Connect with SSMS

  • It's easy to connect to the Database Engine from tools that are running on the same computer if you know the name of the instance and if you're connecting as a member of the local Administrators group on the computer. The following procedures must be performed on the same computer that hosts SQL Server.

Note

This topic discusses connecting to an on-premises SQL Server. For Azure SQL Database, see Connect to Azure SQL Database.

Determine the name of the instance of the Database Engine

  1. Log into Windows as a member of the Administrators group, and open Management Studio.

  2. In the Connect to Server dialog box, select Cancel.

  3. If Registered Servers isn't displayed, on the View menu, select Registered Servers.

  4. With Database Engine selected on the Registered Servers toolbar, expand Database Engine, right-click Local Server Groups, point to Tasks, and then select Register Local Servers. Expand Local Server Groups to see all the instances of the Database Engine installed on the computer displayed. The default instance is unnamed and is shown as the computer name. A named instance displays as the computer name followed by a backward slash (\) and then the instance's name. For SQL Server Express, the instance is named <computer_name>\sqlexpress unless the name was changed during setup.

Verify that the Database Engine is running

  1. In Registered Servers, if the name of your instance of SQL Server has a green dot with a white arrow next to the name, the Database Engine is running and no further action is necessary.

  2. If the name of your instance of SQL Server has a red dot with a white square next to the name, the Database Engine is stopped. Right-click the name of the Database Engine, select Service Control, and then select Start. After a confirmation dialog box, the Database Engine should start, and the circle should turn green with a white arrow.

Connect to the Database Engine

At least one administrator account was selected when SQL Server was being installed. Perform the following step while logged into Windows as an administrator.

  1. In Management Studio, on the File menu, select Connect Object Explorer.

    • The Connect to Server dialog box opens. The Server type box displays the type of component that was last used.
  2. Select Database Engine.

  3. In the Server name box, type the name of the instance of the Database Engine. For the default instance of SQL Server, the server name is the computer name. The server name for a named instance of SQL Server is the <computer_name>\<instance_name>, such as ACCTG_SRVR\SQLEXPRESS. The following screenshot shows connecting to the default (unnamed) instance of SQL Server on a computer named PracticeComputer. The user logged into Windows is Mary from the Contoso domain. When using Windows Authentication, you can't change the user name.

  4. Select Connect.

Note

This tutorial assumes you are new to SQL Server and have no special problems connecting. For detailed troubleshooting steps, see Troubleshooting Connecting to the SQL Server Database Engine.

Authorize extra connections

Now that you've connected to SQL Server as an administrator, one of your first tasks is authorizing other users to connect. You do this by creating a login and authorizing that login to access a database as a user. Logins can be created using Windows authentication, SQL authentication, or Microsoft Entra authentication. Windows authentication logins use credentials from Windows. SQL authentication logins store the authentication information in SQL Server and are independent of your Windows credentials. Logins from Microsoft Entra ID (formerly Azure Active Directory) use credentials from cloud-based identities. You can learn more about this method from the following article - Use Microsoft Entra authentication.

Use Windows Authentication whenever possible.

Tip

Most organizations have domain users and will use Windows Authentication. You can experiment by creating additional local users on your computer. Your computer will authenticate local users, so the domain is the computer name. For example, if your computer is named MyComputer and you create a user named Test, then the Windows description of the user is Mycomputer\Test.

Create a Windows Authentication login

  1. In the previous task, you connected to the Database Engine using Management Studio. In Object Explorer, expand your server instance, expand Security, right-click Logins, and then select New Login. The Login - New dialog box appears.

  2. On the General page, in the Login name box, type a Windows login in the format: <domain>\<login>

    Lesson 1: Connecting to the Database Engine - SQL Server (4)

  3. In the Default database box, select the AdventureWorks database if available. Otherwise, select the master database.

  4. On the Server Roles page, if the new login is to be an administrator, select sysadmin. Otherwise, leave this blank.

  5. On the User Mapping page, select Map for the AdventureWorks2022 database if it's available. Otherwise, select master. The User box is populated with the login. When closed, the dialog box creates this user in the database.

  6. In the Default Schema box, type dbo to map the login to the database owner schema.

  7. Accept the default settings for the Securables and Status boxes and select OK to create the login.

Important

This is basic information to get you started. SQL Server provides a rich security environment.

Related content

  • Connect to SQL Server
  • Troubleshoot Connecting to the SQL Server Database Engine
  • Quickstart: Use SSMS to connect and query Azure SQL database
  • Quickstart: Use Azure Data Studio to connect and query Azure SQL database

Next step

Lesson 2: Connecting from Another Computer

Lesson 1: Connecting to the Database Engine - SQL Server (2024)
Top Articles
Homemade Ginger Syrup & Ginger co*cktail Recipes
EASY Homemade Pretzel Bites Recipe - I Heart Naptime
Printable Whoville Houses Clipart
Section 4Rs Dodger Stadium
12 Rue Gotlib 21St Arrondissem*nt
سریال رویای شیرین جوانی قسمت 338
Gw2 Legendary Amulet
Cosentyx® 75 mg Injektionslösung in einer Fertigspritze - PatientenInfo-Service
Azeroth Pilot Reloaded - Addons - World of Warcraft
Superhot Unblocked Games
What is the difference between a T-bill and a T note?
Worcester On Craigslist
Busted Newspaper S Randolph County Dirt The Press As Pawns
Love In The Air Ep 9 Eng Sub Dailymotion
Bfg Straap Dead Photo Graphic
Khiara Keating: Manchester City and England goalkeeper convinced WSL silverware is on the horizon
Florida History: Jacksonville's role in the silent film industry
Everything you need to know about Costco Travel (and why I love it) - The Points Guy
Mail.zsthost Change Password
Www Craigslist Madison Wi
Craigslist St. Cloud Minnesota
Boston Dynamics’ new humanoid moves like no robot you’ve ever seen
PCM.daily - Discussion Forum: Classique du Grand Duché
Stihl Dealer Albuquerque
Https E22 Ultipro Com Login Aspx
Idle Skilling Ascension
1773x / >
UCLA Study Abroad | International Education Office
Mami No 1 Ott
Tim Steele Taylorsville Nc
Play It Again Sports Forsyth Photos
N.J. Hogenkamp Sons Funeral Home | Saint Henry, Ohio
Mosley Lane Candles
Opsahl Kostel Funeral Home & Crematory Yankton
Cars And Trucks Facebook
Cross-Border Share Swaps Made Easier Through Amendments to India’s Foreign Exchange Regulations - Transatlantic Law International
KITCHENAID Tilt-Head Stand Mixer Set 4.8L (Blue) + Balmuda The Pot (White) 5KSM175PSEIC | 31.33% Off | Central Online
Gold Nugget at the Golden Nugget
Fetus Munchers 1 & 2
Panorama Charter Portal
What Is A K 56 Pink Pill?
Below Five Store Near Me
VDJdb in 2019: database extension, new analysis infrastructure and a T-cell receptor motif compendium
Booknet.com Contract Marriage 2
Here’s What Goes on at a Gentlemen’s Club – Crafternoon Cabaret Club
53 Atms Near Me
Edt National Board
Congressional hopeful Aisha Mills sees district as an economical model
Elizabethtown Mesothelioma Legal Question
Gainswave Review Forum
Booked On The Bayou Houma 2023
Latest Posts
Article information

Author: Ouida Strosin DO

Last Updated:

Views: 5582

Rating: 4.6 / 5 (56 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Ouida Strosin DO

Birthday: 1995-04-27

Address: Suite 927 930 Kilback Radial, Candidaville, TN 87795

Phone: +8561498978366

Job: Legacy Manufacturing Specialist

Hobby: Singing, Mountain biking, Water sports, Water sports, Taxidermy, Polo, Pet

Introduction: My name is Ouida Strosin DO, I am a precious, combative, spotless, modern, spotless, beautiful, precious person who loves writing and wants to share my knowledge and understanding with you.