Skip to content

Commit f0381ed

Browse files
committed
fixed up H2 and H3 headings
1 parent 6044b31 commit f0381ed

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

docs/data-tools/create-a-sql-database-by-using-a-designer.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,14 @@ manager: ghogen
1818
ms.technology: "vs-data-tools"
1919
---
2020
# Create a database and add tables in Visual Studio
21-
You can use Visual Studio to create and update a local database file in SQL Server Express LocalDB. You can also create a database by executing Transact-SQL statements in the **SQL Server Object Explorer** tool window in Visual Studio. In this topic, we'll explore the following tasks:
22-
23-
- [Create a project and a local database file](../data-tools/create-a-sql-database-by-using-a-designer.md#BKMK_CreateNewSQLDB)
24-
25-
- [Create tables, columns, primary keys, and foreign keys](../data-tools/create-a-sql-database-by-using-a-designer.md#BKMK_CreateNewTbls)
26-
27-
- [Populate the tables with data](../data-tools/create-a-sql-database-by-using-a-designer.md#BKMK_Populating)
21+
You can use Visual Studio to create and update a local database file in SQL Server Express LocalDB. You can also create a database by executing Transact-SQL statements in the **SQL Server Object Explorer** tool window in Visual Studio. In this topic, we'll create an .mdf file and add tables and keys by using the Table Designer.
2822

2923
## Prerequisites
3024
To complete this walkthrough, you must have the optional **Data storage and processing** workload installed in Visual Studio. To install it, open **Visual Studio Installer** and choose the **Workloads** tab. Under **Web & Cloud**, choose **Data storage and processing**. Choose the **Modify** button to add the workload to Visual Studio.
3125

32-
## <a name="BKMK_CreateNewSQLDB"></a> Create a project and a local database file
26+
## Create a project and a local database file
3327

34-
#### To create a project and a database file
28+
### To create a project and a database file
3529
1. Create a Windows Forms project that's named `SampleDatabaseWalkthrough`.
3630

3731
2. On the menu bar, select **Project**, **Add New Item**.
@@ -42,7 +36,7 @@ To complete this walkthrough, you must have the optional **Data storage and proc
4236

4337
4. Name the database **SampleDatabase**, and then select the **Add** button.
4438

45-
#### To add a data source
39+
### To add a data source
4640
5. If the **Data Sources** window isn't open, open it by selecting the **Shift+Alt+D** keys or, on the menu bar, selecting **View**, **Other Windows**, **Data Sources**.
4741

4842
6. In the **Data Sources** window, select the **Add New Data Source** link.
@@ -59,17 +53,17 @@ To complete this walkthrough, you must have the optional **Data storage and proc
5953

6054
11. One the **Choose your Database Objects** page, you'll see a message that says the database doesn't contain any objects. Choose **Finish**.
6155

62-
#### To view properties of the data connection
56+
### To view properties of the data connection
6357
You can view the connection string for the SampleDatabase.mdf file by opening the properties window of the data connection:
6458

6559
- In Visual Studio, select **View**, **SQL Server Object Explorer** if that window isn't already open. Open the properties window by expanding the **Data Connections** node, opening the shortcut menu for SampleDatabase.mdf, and then selecting **Properties**.
6660

6761
- Alternatively, you can select **View**, **Server Explorer**, if that window isn't already open. Open the properties window by expanding the **Data Connections** node. Open the shortcut menu for SampleDatabase.mdf, and then select **Properties**.
6862

69-
## <a name="BKMK_CreateNewTbls"></a> Create tables, columns, primary keys, and foreign keys
63+
## Create tables and keys by using Table Designer
7064
In this section, you'll create two tables, a primary key in each table, and a few rows of sample data. You'll also create a foreign key to specify how records in one table correspond to records in the other table.
7165

72-
#### To create the Customers table using Table Designer
66+
### To create the Customers table
7367
1. In **Server Explorer** or **SQL Server Object Explorer**, expand the **Data Connections** node, and then expand the **SampleDatabase.mdf** node.
7468

7569
2. Open the shortcut menu for **Tables**, and then select **Add New Table**.
@@ -105,7 +99,7 @@ In this section, you'll create two tables, a primary key in each table, and a fe
10599
106100
Your changes are saved to the local database file.
107101
108-
#### To create the Orders table
102+
### To create the Orders table
109103
1. Add another table, and then add a row for each entry in the following table:
110104
111105
|Column name|Data type|Allow nulls|
@@ -129,7 +123,7 @@ In this section, you'll create two tables, a primary key in each table, and a fe
129123
130124
Your changes are saved to the local database file.
131125
132-
#### To create a foreign key
126+
### To create a foreign key
133127
1. In the context pane on the right side of the grid, open the shortcut menu for **Foreign Keys**, and then select **Add New Foreign Key**, as the following illustration shows.
134128
135129
![Adding a foreign key in Table Designer](../data-tools/media/foreignkey.png "ForeignKey")
@@ -148,9 +142,9 @@ In this section, you'll create two tables, a primary key in each table, and a fe
148142
149143
Your changes are saved to the local database file.
150144
151-
## <a name="BKMK_Populating"></a> Populate the tables with data
145+
## Populate the tables with data
152146
153-
#### To populate the tables with data
147+
### To populate the tables with data
154148
155149
1. In **Server Explorer** or **SQL Server Object Explorer**, expand the node for the sample database.
156150

0 commit comments

Comments
 (0)