You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Develop and Deploy SQL Server databases for Linux | Microsoft Docs
3
3
description: SQL Server Data Tools with Visual Studio is a powerful development and database lifecycle management environment for SQL Server on Linux.
4
-
author: VanMSFT
4
+
author: VanMSFT
5
5
ms.author: vanto
6
-
ms.date: 03/17/2017
7
-
ms.topic: conceptual
6
+
ms.reviewer: randolphwest
7
+
ms.date: 08/18/2022
8
8
ms.prod: sql
9
9
ms.technology: linux
10
-
ms.assetid: 1e924704-e07c-4a8b-b243-8c1dd8cff0d3
10
+
ms.topic: conceptual
11
11
---
12
12
13
13
# Use Visual Studio to create databases for SQL Server on Linux
@@ -20,92 +20,89 @@ SQL Server Data Tools (SSDT) turns Visual Studio into a powerful development and
20
20
21
21
1. If you haven't already installed Visual Studio on your Windows machine, [Download and Install Visual Studio](https://visualstudio.microsoft.com/downloads/). If you don't have a Visual Studio license, Visual Studio Community edition is a free, fully featured IDE for students, open-source, and individual developers.
22
22
23
-
2. During the Visual Studio installation, select **Custom** for the **Choose the type of installation** option. Select **Next**
23
+
1. During the Visual Studio installation, select **Custom** for the **Choose the type of installation** option. Select **Next**
24
24
25
-
3. Select **Microsoft SQL Server Data Tools**, **Git for Windows**, and **GitHub Extension for Visual Studio** from the feature selection list.
25
+
1. Select **Microsoft SQL Server Data Tools**, **Git for Windows**, and **GitHub Extension for Visual Studio** from the feature selection list.
:::image type="content" source="media/sql-server-linux-develop-use-ssdt/ssdt-setup.png" alt-text="Screenshot of SSDT setup.":::
28
28
29
-
4. Continue and finish the installation of Visual Studio. It can take a few minutes.
29
+
1. Continue and finish the installation of Visual Studio. It can take a few minutes.
30
30
31
-
## Upgrade SQL Server Data Tools to SSDT 17.0 RC release
31
+
## Get the latest version of SQL Server Data Tools
32
32
33
-
SQL Server on Linux is supported by SSDT version 17.0 RC or later.
33
+
SQL Server on Linux is supported by SSDT version 17.0 or later.
34
34
35
-
*[Download and Install SSDT 17.0 RC2](https://go.microsoft.com/fwlink/?linkid=837939).
35
+
-[Download SQL Server Data Tools (SSDT) for Visual Studio](../ssdt/download-sql-server-data-tools-ssdt.md)
36
36
37
37
## Create a new database project in source control
38
38
39
39
1. Launch Visual Studio.
40
40
41
-
2. Select **Team Explorer** on the **View** menu.
41
+
1. Select **Team Explorer** on the **View** menu.
42
42
43
-
3. Select **New** in **Local Git Repository** section on the **Connect** page.
43
+
1. Select **New** in **Local Git Repository** section on the **Connect** page.
44
44
45
-
<imgsrc="./media/sql-server-linux-develop-use-ssdt/git-repository.png"alt="Screenshot of the Local Git Repository section with the New option called out."/>
45
+
:::image type="content" source="media/sql-server-linux-develop-use-ssdt/git-repository.png" alt-text="Screenshot of the Local Git Repository section with the New option called out.":::
46
46
47
-
4. Click**Create**. After the local Git repository is created, double-click **SSDTRepo**.
47
+
1. Select**Create**. After the local Git repository is created, double-click **SSDTRepo**.
48
48
49
-
5. Select **New** in the **Solutions** section. Select **SQL Server** under **Other Languages** node in the **New Project** dialog.
49
+
1. Select **New** in the **Solutions** section. Select **SQL Server** under **Other Languages** node in the **New Project** dialog.
50
50
51
-
<imgsrc="./media/sql-server-linux-develop-use-ssdt/new-project.png"alt="Screenshot of the Solutions section with the New option and SQL Server option called out."/>
51
+
:::image type="content" source="media/sql-server-linux-develop-use-ssdt/new-project.png" alt-text="Screenshot of the Solutions section with the New option and SQL Server option called out.":::
52
52
53
-
6. Type in **TutorialDB** for the name and select **OK** to create a new database project.
53
+
1. Type in **TutorialDB** for the name and select **OK** to create a new database project.
54
54
55
55
## Create a new table in the database project
56
56
57
57
1. Select **Solution Explorer** on the **View** menu.
58
58
59
-
2. Open the database project menu by right-clicking on **TutorialDB** in Solution Explorer.
59
+
1. Open the database project menu by right-clicking on **TutorialDB** in Solution Explorer.
:::image type="content" source="media/sql-server-linux-develop-use-ssdt/create-table.png" alt-text="Screenshot showing how to create a new table using Add > Table.":::
64
64
65
-
4. Using table designer, add two columns, Name `nvarchar(50)` and Location `nvarchar(50)`, as shown in the picture. SSDT generates the `CREATE TABLE` script as you add the columns in the designer.
65
+
1. Using table designer, add two columns, Name `nvarchar(50)` and Location `nvarchar(50)`, as shown in the picture. SSDT generates the `CREATE TABLE` script as you add the columns in the designer.
66
66
67
-
<imgsrc="./media/sql-server-linux-develop-use-ssdt/add-columns.png"alt="Screenshot of the table designer with the Name and Location values called out."/>
67
+
:::image type="content" source="media/sql-server-linux-develop-use-ssdt/add-columns.png" alt-text="Screenshot of the table designer with the Name and Location values called out.":::
68
68
69
-
5. Save the **Table1.sql** file.
69
+
1. Save the **Table1.sql** file.
70
70
71
71
## Build and validate the database
72
72
73
-
1. Open the database project menu on **TutorialDB** and select **Build**. SSDT compiles .sql source code files in your project and builds a Data-tier Application package (dacpac) file. This can be used to publish a database to your SQL Server instance on Linux.
73
+
1. Open the database project menu on **TutorialDB** and select **Build**. SSDT compiles .sql source code files in your project and builds a Data-tier Application package (dacpac) file. This can be used to publish a database to your SQL Server instance on Linux.
74
74
75
-
<imgsrc="./media/sql-server-linux-develop-use-ssdt/build.png"alt="Screenshot showing the TutorialDB with the Build option called out."/>
75
+
:::image type="content" source="media/sql-server-linux-develop-use-ssdt/build.png" alt-text="Screenshot showing the TutorialDB with the Build option called out.":::
76
76
77
-
2. Check the build success message in **Output** window in Visual Studio.
77
+
1. Check the build success message in **Output** window in Visual Studio.
78
78
79
79
## Publish the database to SQL Server instance on Linux
80
80
81
81
1. Open the database project menu on **TutorialDB** and select **Publish**.
82
82
83
-
2. Select **Edit** to select your SQL Server instance on Linux.
83
+
1. Select **Edit** to select your SQL Server instance on Linux.
:::image type="content" source="media/sql-server-linux-develop-use-ssdt/publish-dialog.png" alt-text="Screenshot showing the Publish option with the Edit option called out":::
86
86
87
-
3. On the connection dialog, type in the IP address or host name of your SQL Server instance on Linux, user name and password.
87
+
1. On the connection dialog, type in the IP address or host name of your SQL Server instance on Linux, user name and password.
:::image type="content" source="media/sql-server-linux-develop-use-ssdt/publish-result.png" alt-text="Screenshot showing the publish result with View Script and View Result called out.":::
98
98
99
99
You've successfully created a new database on SQL Server instance on Linux and learned the basics of developing a database with a source-controlled database project.
100
100
101
101
## Next steps
102
102
103
-
If you're new to T-SQL, see [Tutorial: Writing Transact-SQL Statements](../t-sql/tutorial-writing-transact-sql-statements.md).
104
-
105
-
For more information about developing a database with SQL Data Tools, see the below articles.
106
-
107
-
*[Download and Install Visual Studio](https://www.visualstudio.com/downloads/)
108
-
*[Download and Install SSDT](../ssdt/download-sql-server-data-tools-ssdt.md)
0 commit comments