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
@@ -53,22 +53,22 @@ The following steps create a database named **TutorialDB**:
53
53
54
54
2. Paste the following snippet into the query window: and then select **Run**.
55
55
56
-
```sql
57
-
USE master
58
-
GO
59
-
IF NOT EXISTS (
60
-
SELECT name
61
-
FROMsys.databases
62
-
WHERE name = N'TutorialDB'
63
-
)
64
-
CREATE DATABASE [TutorialDB];
65
-
GO
66
-
IF SERVERPROPERTY('ProductVersion') >'12'
67
-
ALTERDATABASE [TutorialDB] SET QUERY_STORE=ON;
68
-
GO
69
-
```
70
-
71
-
After the query completes, the new **TutorialDB** appears in the list of databases. If you don't see it, right-click the **Databases** node and select **Refresh**.
56
+
```sql
57
+
USE master
58
+
GO
59
+
IF NOT EXISTS (
60
+
SELECT name
61
+
FROMsys.databases
62
+
WHERE name = N'TutorialDB'
63
+
)
64
+
CREATE DATABASE [TutorialDB];
65
+
GO
66
+
IF SERVERPROPERTY('ProductVersion') >'12'
67
+
ALTERDATABASE [TutorialDB] SET QUERY_STORE=ON;
68
+
GO
69
+
```
70
+
71
+
After the query completes, the new **TutorialDB** appears in the list of databases. If you don't see it, right-click the **Databases** node and select **Refresh**.
@@ -85,52 +85,52 @@ The query editor is still connected to the *master* database, but we want to cre
85
85
> [!NOTE]
86
86
> You can append this too, or overwrite the previous query in the editor. Note that clicking **Run** executes only the query that is selected. If nothing is selected, clicking **Run** executes all queries in the editor.
87
87
88
-
```sql
89
-
-- Create a new table called 'Customers' in schema 'dbo'
-- Create a new table called 'Customers' in schema 'dbo'
90
+
-- Drop the table if it already exists
91
+
IF OBJECT_ID('dbo.Customers', 'U') IS NOT NULL
92
+
DROP TABLE dbo.Customers;
93
+
GO
94
+
-- Create the table in the specified schema
95
+
CREATE TABLE dbo.Customers
96
+
(
97
+
CustomerId int NOT NULL PRIMARY KEY, -- primary key column
98
+
Name nvarchar(50) NOT NULL,
99
+
Location nvarchar(50) NOT NULL,
100
+
Email nvarchar(50) NOT NULL
101
+
);
102
+
GO
103
+
```
104
104
105
105
After the query completes, the new **Customers** table appears in the list of tables. You might need to right-click the **TutorialDB > Tables** node and select **Refresh**.
106
106
107
107
## Insert rows
108
108
109
109
- Paste the following snippet into the query window and click **Run**:
0 commit comments