Skip to content

Commit f92773f

Browse files
committed
Merge branch 'master' of https://github.com/MicrosoftDocs/sql-docs-pr into 20190501_OCCI
2 parents 54dd972 + 2f04dfc commit f92773f

9 files changed

Lines changed: 325 additions & 38 deletions

File tree

docs/analysis-services/multidimensional-models-olap-logical-cube-objects/partitions-analysis-services-multidimensional-data.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ manager: kfile
3434
Columns that are not used to define measures in the measure group can be present in some fact tables but absent in others. Similarly, columns that are not used to define attributes in related dimension tables can be present in some databases but absent in others. Tables that are not used for either fact tables or related dimension tables can be present in some databases but absent in others.
3535

3636
## Data Sources and Partition Storage
37-
A partition is based either on a table or view in a data source, or on a table or named query in a data source view. The location where partition data is stored is defined by the data source binding. Typically, you can partition a measure group horizontally or vertically:
37+
A partition is based either on a table or view in a data source, or on a table or named query in a data source view. The location where partition data is stored is defined by the data source binding. You can partition a measure group using either a single-table partition scheme, or a multi-table partition scheme:
3838

39-
- In a horizontally partitioned measure group, each partition in a measure group is based on a separate table. This kind of partitioning is appropriate when data is separated into multiple tables. For example, some relational databases have a separate table for each month's data.
39+
- In a multi-table partition scheme each partition in a measure group partition is based on a separate table. This kind of partitioning is appropriate when data is separated into multiple tables. For example, some relational databases have a separate table for each month's data.
4040

41-
- In a vertically partitioned measure group, a measure group is based on a single table, and each partition is based on a source system query that filters the data for the partition. For example, if a single table contains several months data, the measure group could still be partitioned by month by applying a Transact-SQL WHERE clause that returns a separate month's data for each partition.
41+
- In a single-table partition scheme a measure group is based on a single table, and each partition is based on a source system query that filters the data for the partition. For example, if a single table contains several months data, the measure group could still be partitioned by month by applying a Transact-SQL WHERE clause that returns a separate month's data for each partition.
4242

4343
Each partition has storage settings that determine whether the data and aggregations for the partition are stored in the local instance of [!INCLUDE[ssASnoversion](../../includes/ssasnoversion-md.md)] or in a remote partition using another instance of [!INCLUDE[ssASnoversion](../../includes/ssasnoversion-md.md)]. The storage settings can also specify the storage mode and whether proactive caching is used to control latency for a partition. For more information, see [Partition Storage Modes and Processing](../../analysis-services/multidimensional-models-olap-logical-cube-objects/partitions-partition-storage-modes-and-processing.md), [Proactive Caching (Partitions)](../../analysis-services/multidimensional-models-olap-logical-cube-objects/partitions-proactive-caching.md), and [Remote Partitions](../../analysis-services/multidimensional-models-olap-logical-cube-objects/partitions-remote-partitions.md).
4444

docs/relational-databases/system-catalog-views/sys-databases-transact-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ If a database is not `ONLINE`, or `AUTO_CLOSE` is set to `ON` and the database i
111111
|**is_temporal_retention_enabled**|**bit**|Indicates whether temporal retention policy cleanup task is enabled.<br /> **Applies to**: [!INCLUDE[ssSDSfull](../../includes/sssdsfull-md.md)]|
112112
|**catalog_collation_type**|**int**|The catalog collation setting:<br />0 = DATABASE_DEFAULT<br />2 = SQL_Latin_1_General_CP1_CI_AS<br /> **Applies to**: [!INCLUDE[ssSDSfull](../../includes/sssdsfull-md.md)]|
113113
|**catalog_collation_type_desc**|**nvarchar(60)**|The catalog collation setting:<br />DATABASE_DEFAULT<br />SQL_Latin_1_General_CP1_CI_AS<br /> **Applies to**: [!INCLUDE[ssSDSfull](../../includes/sssdsfull-md.md)]|
114-
|**Is_result_set_caching_on**|**int**|Reserved for internal use</br>**Applies to**: Azure SQL Data Warehouse
114+
|**is_result_set_caching_on**|**int**|1 = is_result_set_caching_on is on</br>0 = is_result_set_caching_on is off</br>**Applies to**: Azure SQL Data Warehouse Gen2
115115

116116
## Permissions
117117
If the caller of `sys.databases` is not the owner of the database and the database is not `master` or `tempdb`, the minimum permissions required to see the corresponding row are `ALTER ANY DATABASE` or the `VIEW ANY DATABASE` server-level permission, or `CREATE DATABASE` permission in the `master` database. The database to which the caller is connected can always be viewed in `sys.databases`.

docs/t-sql/functions/trim-transact-sql.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,26 @@ ms.assetid: a00245aa-32c7-4ad4-a0d1-64f3d6841153
1818
author: MashaMSFT
1919
ms.author: mathoma
2020
manager: craigg
21-
monikerRange: "=azuresqldb-current||>=sql-server-2017||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current"
21+
monikerRange: "= azure-sqldw-latest||=azuresqldb-current||>=sql-server-2017||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current"
2222
---
2323
# TRIM (Transact-SQL)
2424

25-
[!INCLUDE[tsql-appliesto-ss2017-asdb-xxxx-xxx-md](../../includes/tsql-appliesto-ss2017-asdb-xxxx-xxx-md.md)]
25+
[!INCLUDE[tsql-appliesto-ss2017-asdb-asdw-xxx-md](../../includes/tsql-appliesto-ss2017-asdb-asdw-xxx-md.md)]
2626

2727
Removes the space character `char(32)` or other specified characters from the start or end of a string.
2828

2929
## Syntax
3030

31-
```sql
31+
```
3232
-- Syntax for SQL Server and Azure SQL Database
3333
TRIM ( [ characters FROM ] string )
3434
```
3535

36+
```
37+
-- Syntax for Azure SQL Data Warehouse
38+
TRIM ( string )
39+
```
40+
3641
## Arguments
3742

3843
characters

docs/t-sql/queries/at-time-zone-transact-sql.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ ms.assetid: 311f682f-7f1b-43b6-9ea0-24e36b64f73a
1616
author: VanMSFT
1717
ms.author: vanto
1818
manager: craigg
19+
monikerRange: "= azuresqldb-current ||>= sql-server-2016 ||>= sql-server-linux-2017 ||= azure-sqldw-latest ||= sqlallproducts-allversions"
1920
---
2021
# AT TIME ZONE (Transact-SQL)
21-
[!INCLUDE[tsql-appliesto-ss2016-asdb-xxxx-xxx-md](../../includes/tsql-appliesto-ss2016-asdb-xxxx-xxx-md.md)]
22+
[!INCLUDE[tsql-appliesto-ss2016-asdb-asdw-xxx-md](../../includes/tsql-appliesto-ss2016-asdb-asdw-xxx-md.md)]
2223

2324
Converts an *inputdate* to the corresponding *datetimeoffset* value in the target time zone. When *inputdate* is provided without offset information, the function applies the offset of the time zone assuming that *inputdate* is in the target time zone. If *inputdate* is provided as a *datetimeoffset* value, then **AT TIME ZONE** clause converts it into the target time zone using the time zone conversion rules.
2425

docs/t-sql/statements/alter-database-transact-sql-set-options.md

Lines changed: 148 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ ms.assetid: f76fbd84-df59-4404-806b-8ecb4497c9cc
2929
author: CarlRabeler
3030
ms.author: carlrab
3131
manager: craigg
32-
monikerRange: "=azuresqldb-current||=azuresqldb-current||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current"
32+
monikerRange: "=azuresqldb-current||=azuresqldb-current||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azure-sqldw-latest||=azuresqldb-mi-current"
3333
---
3434
# ALTER DATABASE SET Options (Transact-SQL)
3535

36-
Sets database options in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] and Azure SQL Database. For other ALTER DATABASE options, see [ALTER DATABASE](../../t-sql/statements/alter-database-transact-sql.md).
36+
Sets database options in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], Azure SQL Database and Azure SQL Data Warehouse. For other ALTER DATABASE options, see [ALTER DATABASE](../../t-sql/statements/alter-database-transact-sql.md).
3737

3838
Click one of the following tabs for the syntax, arguments, remarks, permissions, and examples for a particular SQL version with which you're working.
3939

@@ -45,9 +45,9 @@ In the following row, click whichever product name you're interested in. The cli
4545

4646
::: moniker range=">=sql-server-2016||>=sql-server-linux-2017||=sqlallproducts-allversions"
4747

48-
> |||
49-
> |---|---|
50-
> |**_\* SQL Server \*_** &nbsp;|[SQL Database<br />single database/elastic pool](alter-database-transact-sql-set-options.md?view=azuresqldb-current)|[SQL Database<br />managed instance](alter-database-transact-sql-set-options.md?view=azuresqldb-mi-current)|||
48+
> |||||
49+
> |---|---|---|---|
50+
> |**_\* SQL Server \*_** &nbsp;|[SQL Database<br />single database/elastic pool](alter-database-transact-sql-set-options.md?view=azuresqldb-current)|[SQL Database<br />managed instance](alter-database-transact-sql-set-options.md?view=azuresqldb-mi-current)|[SQL Data<br />Warehouse](alter-database-transact-sql-set-options.md?view=azure-sqldw-latest)|||
5151
5252
&nbsp;
5353

@@ -1297,9 +1297,9 @@ SET QUERY_STORE = ON
12971297
::: moniker-end
12981298
::: moniker range="=azuresqldb-current||=sqlallproducts-allversions"
12991299

1300-
> |||
1301-
> |---|---|
1302-
> |[SQL Server](alter-database-transact-sql-set-options.md?view=sql-server-2017)|**_\* SQL Database<br />single database/elastic pool \*_** &nbsp;|[SQL Database<br />managed instance](alter-database-transact-sql-set-options.md?view=azuresqldb-mi-current)|
1300+
> ||||
1301+
> |---|---|---|
1302+
> |[SQL Server](alter-database-transact-sql-set-options.md?view=sql-server-2017)|**_\* SQL Database<br />single database/elastic pool \*_** &nbsp;|[SQL Database<br />managed instance](alter-database-transact-sql-set-options.md?view=azuresqldb-mi-current)||[SQL Data<br />Warehouse](alter-database-transact-sql-set-options.md?view=azure-sqldw-latest)||||
13031303
13041304
&nbsp;
13051305

@@ -2093,9 +2093,9 @@ SET QUERY_STORE = ON
20932093
::: moniker-end
20942094
::: moniker range="=azuresqldb-mi-current||=sqlallproducts-allversions"
20952095

2096-
> |||
2097-
> |---|---|
2098-
> |[SQL Server](alter-database-transact-sql-set-options.md?view=sql-server-2017)|[SQL Database<br />single database/elastic pool](alter-database-transact-sql-set-options.md?view=azuresqldb-current) |**_\* SQL Database<br />managed instance \*_** &nbsp;|
2096+
> ||||
2097+
> |---|---|---|
2098+
> |[SQL Server](alter-database-transact-sql-set-options.md?view=sql-server-2017)|[SQL Database<br />single database/elastic pool](alter-database-transact-sql-set-options.md?view=azuresqldb-current) |**_\* SQL Database<br />managed instance \*_** &nbsp;||[SQL Data<br />Warehouse](alter-database-transact-sql-set-options.md?view=azure-sqldw-latest)||||
20992099
21002100
&nbsp;
21012101

@@ -2800,3 +2800,140 @@ SET QUERY_STORE = ON
28002800
- [Best Practice with the Query Store](../../relational-databases/performance/best-practice-with-the-query-store.md)
28012801

28022802
::: moniker-end
2803+
::: moniker range="=azure-sqldw-latest||=sqlallproducts-allversions"
2804+
2805+
> ||||
2806+
> |---|---|---|
2807+
> |[SQL Server](alter-database-transact-sql-set-options.md?view=sql-server-2017)|[SQL Database<br />single database/elastic pool](alter-database-transact-sql-set-options.md?view=azuresqldb-current)|[SQL Database<br />managed instance](alter-database-transact-sql-set-options.md?view=azuresqldb-mi-current)|**_\* SQL Data<br />Warehouse \*_** &nbsp;||||
2808+
2809+
&nbsp;
2810+
2811+
## Azure SQL Data Warehouse
2812+
2813+
> [!NOTE]
2814+
> Many database set options can be configured for the current session by using [SET Statements](../../t-sql/statements/set-statements-transact-sql.md) and are often configured by applications when they connect. Session level set options override the **ALTER DATABASE SET** values. The database options described below are values that can be set for sessions that don't explicitly provide other set option values.
2815+
2816+
## Syntax
2817+
2818+
```
2819+
ALTER DATABASE { database_name | Current }
2820+
SET
2821+
{
2822+
<optionspec> [ ,...n ]
2823+
}
2824+
;
2825+
2826+
<auto_option> ::=
2827+
{}
2828+
RESULT_SET_CACHING { ON | OFF}
2829+
}
2830+
```
2831+
2832+
## Arguments
2833+
2834+
*database_name*
2835+
Is the name of the database to be modified.
2836+
2837+
**\<auto_option> ::=**
2838+
2839+
Controls automatic options.
2840+
2841+
**Permissions**:
2842+
Requires these permissions:
2843+
2844+
- Server-level principal login (the one created by the provisioning process), or
2845+
- Member of the dbmanager database role.
2846+
2847+
The owner of the database cannot alter the database unless the owner is a member of the dbmanager role.
2848+
2849+
<a name="result_set_caching"></a> RESULT_SET_CACHING { ON | OFF } (Preview for Gen2)
2850+
This command must be run while connected to the master database. Change to this database setting takes effect immediately. Storage costs are incurred by caching query result sets. After disabling result caching for a database, previously persisted result cache will immediately be deleted from Azure SQL Data warehouse storage. A new column called is_result_set_caching_on is introduced in the sys.databases to show the result caching setting for a database.
2851+
2852+
ON
2853+
Specifies that query result sets returned from this database will be cached in Azure SQL Data Warehouse storage.
2854+
2855+
OFF
2856+
Specifies that query result sets returned from this database will not be cached in Azure SQL Data warehouse storage.
2857+
Users can tell if a query was executed with a result cache hit or miss by querying sys.pdw_request_steps with a specific request_id. If there is a cache hit, the query result will have a single step with following details:
2858+
2859+
|**Column name** |**Operator** |**Value** |
2860+
|----|----|----|
2861+
| operation_type|=|ReturnOperation|
2862+
|step_index|=|0|
2863+
|location_type|=|Control|
2864+
command|Like|%DWResultCacheDb%|
2865+
| | |
2866+
2867+
## Examples
2868+
2869+
### Enable result set caching for a database
2870+
2871+
```sql
2872+
ALTER DATABASE myTestDW
2873+
SET RESULT_SET_CACHING ON;
2874+
```
2875+
2876+
### Disable result set caching for a database
2877+
2878+
```sql
2879+
ALTER DATABASE myTestDW
2880+
SET RESULT_SET_CACHING OFF;
2881+
```
2882+
2883+
### Check result set caching setting for a database
2884+
2885+
```sql
2886+
SELECT name, is_result_set_caching
2887+
FROM sys.databases;
2888+
```
2889+
2890+
### Check for number of queries with result set cache hit and cache miss
2891+
2892+
```sql
2893+
SELECT
2894+
Queries=CacheHits+CacheMisses,
2895+
CacheHits,
2896+
CacheMisses
2897+
CacheHitPct=CacheHits*1.0/(CacheHits+CacheMisses)
2898+
FROM
2899+
(SELECT
2900+
CacheHits=count(distinct case when s.command like '%DWResultCacheDb%' and
2901+
r.resource_class IS NULL and s.operation_type = 'ReturnOperation' and
2902+
s.step_index = 0 then s.request_id else null end) ,
2903+
CacheMisses=count(distinct case when r.resource_class IS NOT NULL then
2904+
s.request_id else null end)
2905+
FROM sys.dm_pdw_request_steps s
2906+
JOIN sys.dm_pdw_exec_requests r
2907+
ON s.request_id = r.request_id) A;
2908+
```
2909+
2910+
### Check for result set cache hit or cache miss for a query
2911+
2912+
```sql
2913+
If
2914+
(SELECT step_index
2915+
FROM sys.dm_pdw_request_steps
2916+
WHERE request_id = 'QID58286' and operation_type = 'ReturnOperation' and command like '%DWResultCacheDb%') = 0
2917+
SELECT 1 as is_cache_hit
2918+
ELSE
2919+
SELECT 0 as is_cache_hit;
2920+
```
2921+
2922+
### Check for all queries with result set cache hits
2923+
2924+
```sql
2925+
SELECT *
2926+
FROM sys.dm_pdw_request_steps
2927+
WHERE command like '%DWResultCacheDb%' and step_index = 0;
2928+
```
2929+
2930+
## See Also
2931+
2932+
- [DATABASEPROPERTYEX](../../t-sql/functions/databasepropertyex-transact-sql.md)
2933+
- [DROP DATABASE](../../t-sql/statements/drop-database-transact-sql.md)
2934+
- [sys.databases](../../relational-databases/system-catalog-views/sys-databases-transact-sql.md)
2935+
- [Best practices for Azure SQL Data Warehouse](/azure/sql-data-warehouse/sql-data-warehouse-best-practices#maintain-statistics)
2936+
- [Designing tables in Azure SQL Data Warehouse](/azure/sql-data-warehouse/sql-data-warehouse-tables-overview#statistics)
2937+
- [SQL Data Warehouse language elements](/azure/sql-data-warehouse/sql-data-warehouse-reference-tsql-language-elements)
2938+
2939+
::: moniker-end

docs/t-sql/statements/alter-database-transact-sql.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -725,12 +725,13 @@ ALTER DATABASE { database_name | CURRENT }
725725
}
726726
727727
```
728+
728729
## Arguments
729730

730-
*database_name*
731+
*database_name*
731732
Is the name of the database to be modified.
732733

733-
CURRENT
734+
CURRENT
734735
Designates that the current database in use should be altered.
735736

736737
## Remarks
@@ -791,16 +792,24 @@ ALTER DATABASE WideWorldImporters
791792

792793
## Overview: Azure SQL Data Warehouse
793794

794-
Modifies the name, maximum size, or service objective for a database.
795+
In Azure SQL Dta Warehouse, 'ALTER DATABASE' modifies the name, maximum size, or service objective for a database.
795796

796-
## Syntax
797+
Because of its length, the ALTER DATABASE syntax is separated into the multiple articles.
797798

798-
```
799-
ALTER DATABASE database_name
799+
[ALTER DATABASE SET Options](../../t-sql/statements/alter-database-transact-sql-set-options.md)
800+
Provides the syntax and related information for changing the attributes of a database by using the SET options of ALTER DATABASE.
800801

802+
## Syntax
803+
804+
```console
805+
ALTER DATABASE { database_name | CURRENT }
806+
{
801807
MODIFY NAME = new_database_name
802808
| MODIFY ( <edition_option> [, ... n] )
803-
809+
| SET <option_spec> [ ,...n ] [ WITH <termination> ]
810+
}
811+
[;]
812+
804813
<edition_option> ::=
805814
MAXSIZE = {
806815
250 | 500 | 750 | 1024 | 5120 | 10240 | 20480
@@ -818,13 +827,13 @@ ALTER DATABASE database_name
818827

819828
## Arguments
820829

821-
*database_name*
830+
*database_name*
822831
Specifies the name of the database to be modified.
823832

824-
MODIFY NAME = *new_database_name*
833+
MODIFY NAME = *new_database_name*
825834
Renames the database with the name specified as *new_database_name*.
826835

827-
MAXSIZE
836+
MAXSIZE
828837
The default is 245,760 GB (240 TB).
829838

830839
**Applies to:** Optimized for Compute Gen1
@@ -835,7 +844,7 @@ The maximum allowable size for the database. The database cannot grow beyond MAX
835844

836845
The maximum allowable size for rowstore data in the database. Data stored in rowstore tables, a columnstore index's deltastore, or a nonclustered index on a clustered columnstore index cannot grow beyond MAXSIZE. Data compressed into columnstore format does not have a size limit and is not constrained by MAXSIZE.
837846

838-
SERVICE_OBJECTIVE
847+
SERVICE_OBJECTIVE
839848
Specifies the performance level. For more information about service objectives for SQL Data Warehouse, see [Data Warehouse Units (DWUs)](https://docs.microsoft.com/azure/sql-data-warehouse/what-is-a-data-warehouse-unit-dwu-cdwu).
840849

841850
## Permissions

0 commit comments

Comments
 (0)