0% found this document useful (0 votes)
4 views

Installation of SQL

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Installation of SQL

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Steps to download and install MS-SQL

Go to https://www.microsoft.com/en-us/sql-server/sql-server-
downloads.

Scroll down to see the available editions:

 Developer: Ideal for development and testing (free).

 Express: A lightweight version for smaller applications (free).

Click Download now under your chosen edition (typically Express for
casual users).

After the file is downloaded, find it in your Downloads folder or wherever


you have chosen to download the file.

Double-click the downloaded exe file.

A window will pop up.

The installer will give you choices:

Basic: Quick and simple for beginners. (Pick this!)

Custom: For advanced users.

Download Media: To save the files for later.

Click on Basic which is good for beginners.

You’ll see a page with a lot of words (the license agreement).

Simply click the Accept button to continue.

Click Install

It might take a few minutes to install.

When it’s done, you’ll see a big Installation Successful message with a
dialog box.

SQL Server is ready.

Install SSMS (SQL Server Management Studio)


Go back to the website, scroll down to the SQL Server Management
Studio (SSMS) section: that means, click install SSMS….
Click the link that says Download SSMS.

This takes you to another page. Click the Download button for SSMS.

Once the file is downloaded, double-click it to install SSMS.

Follow the steps in the dialog box and let it install.

Connect to SQL Server

Launch SQL Server Management Studio (SSMS) from the Start menu.

When prompted to connect to a server:

 The Server Name field should auto-populate. If it’s blank, type


localhost (for a local server).

 Keep the Authentication as Windows Authentication unless you’ve


set up SQL Server Authentication.
Click Connect.

Start Using SQL Server

1. Once connected, you can create databases, run SQL queries, and
manage your data.

2. Begin by exploring the Object Explorer in SSMS, which shows all the
databases and their components.
To use SQL in Visual Studio Code (VS Code), you need to set up a database
system (like SQL Server) and configure VS Code with the appropriate tools.
Here’s a step-by-step guide to get you started:

Install SQL Server

If you haven’t installed SQL Server yet, follow these steps:

1. Download SQL Server Express or Developer from Microsoft SQL Server


Downloads.

2. Follow the installation steps (refer to the SQL Server installation guide
above if needed).

3. Ensure the SQL Server instance is running after installation.

Step 2: Install SQL Server Management Studio (Optional but


Recommended)

1. Download SSMS from the SSMS page.

2. Install and connect to SQL Server to ensure it’s working properly.

Step 3: Install Visual Studio Code

1. Download Visual Studio Code from https://code.visualstudio.com/.

2. Install it by running the downloaded file and following the on-screen


instructions.

Install the SQL Server Extension in VS Code

1. Open VS Code.

2. Click on the Extensions icon on the left sidebar (or press


Ctrl+Shift+X).

3. In the search bar, type SQL Server.

4. Select the SQL Server (mssql) extension by Microsoft and click


Install.

Install Required Tools

1. After installing the SQL Server extension, VS Code may prompt you to
install additional tools (like SQL tools for connectivity).

2. Follow the prompts to install these tools.


Set Up a Connection to SQL Server

1. Press Ctrl+Shift+P (or F1) in VS Code to open the Command Palette.

2. Type SQL: Connect and select it.

3. In the connection setup window:

o Server name: Type your SQL Server instance name (e.g.,


localhost or localhost\SQLEXPRESS).

o Authentication type: Choose Windows Authentication (for


local installs) or SQL Login (if configured).

o Username and password: Provide credentials if using SQL


Login.

4. Click Connect.

Write and Run SQL Queries

1. Create a new file in VS Code (Ctrl+N) and save it with a .sql extension
(e.g., test.sql).

2. Write your SQL queries in the file.

3. Right-click in the query editor or use the Command Palette to select


Run Query.

4. The results will appear in the Results Pane at the bottom.

Optional Customizations

1. Set a Default Database:

o After connecting, you can specify a default database for your


queries by editing the connection profile.

2. Install Additional Extensions:

o For better SQL development, install extensions like SQL


Formatter or SQL Tools.

3. Always make sure your SQL Server service is running before trying to
connect from VS Code.
4. If you encounter connectivity issues, check if your SQL Server is
configured to allow remote connections (even for local connections).
5. You can use the Terminal in VS Code for additional database-related
tasks with CLI tools like sqlcmd or bcp.

You might also like