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
Copy file name to clipboardExpand all lines: articles/sql-data-warehouse/sql-data-warehouse-develop-ctas.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: CREATE TABLE AS SELECT (CTAS)
3
-
description: Explanation and examples of the CREATE TABLE AS SELECT (CTAS) statement in Azure SQL Data Warehouse for developing solutions.
3
+
description: Explanation and examples of the CREATE TABLE AS SELECT (CTAS) statement in SQL Analytics for developing solutions.
4
4
services: sql-data-warehouse
5
5
author: XiaoyuMSFT
6
6
manager: craigg
@@ -11,11 +11,12 @@ ms.date: 03/26/2019
11
11
ms.author: xiaoyul
12
12
ms.reviewer: igorstan
13
13
ms.custom: seoapril2019
14
+
ms.custom: azure-synapse
14
15
---
15
16
16
-
# CREATE TABLE AS SELECT (CTAS) in Azure SQL Data Warehouse
17
+
# CREATE TABLE AS SELECT (CTAS) in SQL Analytics
17
18
18
-
This article explains the CREATE TABLE AS SELECT (CTAS) T-SQL statement in Azure SQL Data Warehouse for developing solutions. The article also provides code examples.
19
+
This article explains the CREATE TABLE AS SELECT (CTAS) T-SQL statement in SQL Analytics for developing solutions. The article also provides code examples.
19
20
20
21
## CREATE TABLE AS SELECT
21
22
@@ -118,7 +119,7 @@ DROP TABLE FactInternetSales_old;
118
119
119
120
## Use CTAS to work around unsupported features
120
121
121
-
You can also use CTAS to work around a number of the unsupported features listed below. This method can often prove helpful, because not only will your code be compliant, but it will often run faster on SQL Data Warehouse. This performance is a result of its fully parallelized design. Scenarios include:
122
+
You can also use CTAS to work around a number of the unsupported features listed below. This method can often prove helpful, because not only will your code be compliant, but it will often run faster on SQL Analytics. This performance is a result of its fully parallelized design. Scenarios include:
122
123
123
124
* ANSI JOINS on UPDATEs
124
125
* ANSI JOINs on DELETEs
@@ -169,7 +170,7 @@ ON [acs].[EnglishProductCategoryName] = [fis].[EnglishProductCategoryName]
169
170
AND [acs].[CalendarYear] = [fis].[CalendarYear];
170
171
```
171
172
172
-
SQL Data Warehouse doesn't support ANSI joins in the `FROM` clause of an `UPDATE` statement, so you can't use the previous example without modifying it.
173
+
SQL Analytics doesn't support ANSI joins in the `FROM` clause of an `UPDATE` statement, so you can't use the previous example without modifying it.
173
174
174
175
You can use a combination of a CTAS and an implicit join to replace the previous example:
175
176
@@ -203,7 +204,7 @@ DROP TABLE CTAS_acs;
203
204
204
205
## ANSI join replacement for delete statements
205
206
206
-
Sometimes the best approach for deleting data is to use CTAS, especially for `DELETE` statements that use ANSI join syntax. This is because SQL Data Warehouse doesn't support ANSI joins in the `FROM` clause of a `DELETE` statement. Rather than deleting the data, select the data you want to keep.
207
+
Sometimes the best approach for deleting data is to use CTAS, especially for `DELETE` statements that use ANSI join syntax. This is because SQL Analytics doesn't support ANSI joins in the `FROM` clause of a `DELETE` statement. Rather than deleting the data, select the data you want to keep.
207
208
208
209
The following is an example of a converted `DELETE` statement:
You can see that type consistency and maintaining nullability properties on a CTAS is an engineering best practice. It helps to maintain integrity in your calculations, and also ensures that partition switching is possible.
409
410
410
-
CTAS is one of the most important statements in SQL Data Warehouse. Make sure you thoroughly understand it. See the [CTAS documentation](/sql/t-sql/statements/create-table-as-select-azure-sql-data-warehouse).
411
+
CTAS is one of the most important statements in SQL Analytics. Make sure you thoroughly understand it. See the [CTAS documentation](/sql/t-sql/statements/create-table-as-select-azure-sql-data-warehouse).
For more reference information, see [T-SQL statements in Azure SQL Data Warehouse](sql-data-warehouse-reference-tsql-statements.md), and [System views in Azure SQL Data Warehouse](sql-data-warehouse-reference-tsql-system-views.md).
277
+
For more reference information, see [T-SQL statements in SQL Analytics](sql-data-warehouse-reference-tsql-statements.md), and [System views in SQL Analytics](sql-data-warehouse-reference-tsql-system-views.md).
For more reference information, see [T-SQL language elements in Azure SQL Data Warehouse](sql-data-warehouse-reference-tsql-language-elements.md), and [System views in Azure SQL Data Warehouse](sql-data-warehouse-reference-tsql-system-views.md).
119
+
For more reference information, see [T-SQL language elements in SQL Analytics](sql-data-warehouse-reference-tsql-language-elements.md), and [System views in SQL Analytics](sql-dat-warehouse-reference-tsql-system-views.md).
## SQL Server DMVs available in SQL Data Warehouse
144
-
SQL Data Warehouse exposes many of the SQL Server dynamic management views (DMVs). These views, when queried in SQL Data Warehouse, are reporting the state of SQL Databases running on the distributions.
144
+
## SQL Server DMVs available in SQL Analytics
145
+
SQL Analytics exposes many of the SQL Server dynamic management views (DMVs). These views, when queried in SQL Analytics, are reporting the state of SQL Databases running on the distributions.
145
146
146
-
SQL Data Warehouse and Analytics Platform System's Parallel Data Warehouse (PDW) use the same system views. Each DMV has a column called pdw_node_id, which is the identifier for the Compute node.
147
+
SQL Analytics and Parallel Data Warehouse (PDW) use the same system views. Each DMV has a column called pdw_node_id, which is the identifier for the Compute node.
147
148
148
149
> [!NOTE]
149
150
> To use these views, insert ‘pdw_nodes_’ into the name, as shown in the following table:
150
151
>
151
152
>
152
153
153
-
| DMV name in SQL Data Warehouse| SQL Server Transact-SQL article|
154
+
| DMV name in SQL Analytics| SQL Server Transact-SQL article|
For more reference information, see [T-SQL statements in Azure SQL Data Warehouse](sql-data-warehouse-reference-tsql-statements.md), and [T-SQL language elements in Azure SQL Data Warehouse](sql-data-warehouse-reference-tsql-language-elements.md).
242
+
For more reference information, see [T-SQL statements in SQL Analytics](sql-data-warehouse-reference-tsql-statements.md), and [T-SQL language elements in SQL Analytics](sql-data-warehouse-reference-tsql-language-elements.md).
0 commit comments