Skip to content

Commit dcdd8df

Browse files
Add delimiters around object identifers as needed
1 parent 95acefd commit dcdd8df

10 files changed

Lines changed: 65 additions & 60 deletions

docs/relational-databases/polybase/polybase-configure-mongodb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The following Transact-SQL commands are used in this section:
4343
- Replace `<password>` with the appropriate password.
4444

4545
```sql
46-
CREATE DATABASE SCOPED CREDENTIAL <credential_name> WITH IDENTITY = '<username>', Secret = '<password>';
46+
CREATE DATABASE SCOPED CREDENTIAL [<credential_name>] WITH IDENTITY = '<username>', Secret = '<password>';
4747
```
4848

4949
> [!IMPORTANT]

docs/relational-databases/polybase/polybase-configure-odbc-generic.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The following Transact-SQL commands are used in this section:
5151
1. Create a database scoped credential for accessing the ODBC source.
5252

5353
```sql
54-
CREATE DATABASE SCOPED CREDENTIAL <credential_name> WITH IDENTITY = '<username>', Secret = '<password>';
54+
CREATE DATABASE SCOPED CREDENTIAL [<credential_name>] WITH IDENTITY = '<username>', Secret = '<password>';
5555
```
5656

5757
For example, the following example creates a credential named `credential_name`, with an identity of `username` and a complex password.
@@ -63,12 +63,12 @@ The following Transact-SQL commands are used in this section:
6363
1. Create an external data source with [CREATE EXTERNAL DATA SOURCE](../../t-sql/statements/create-external-data-source-transact-sql.md).
6464

6565
```sql
66-
CREATE EXTERNAL DATA SOURCE <external_data_source_name>
66+
CREATE EXTERNAL DATA SOURCE [<external_data_source_name>]
6767
WITH ( LOCATION = 'odbc://<ODBC server address>[:<port>]',
6868
CONNECTION_OPTIONS = 'Driver={<Name of Installed Driver>};
6969
ServerNode = <name of server address>:<Port>',
7070
-- PUSHDOWN = [ON] | OFF,
71-
CREDENTIAL = <credential_name> );
71+
CREDENTIAL = [<credential_name>] );
7272
```
7373

7474
The following example creates an external data source:
@@ -101,15 +101,15 @@ The following Transact-SQL commands are used in this section:
101101
Create an external table. You will need to reference the external data source created above using the `DATA_SOURCE` argument and specify the source table as the `LOCATION`. You do not need to reference all columns but you will need to ensure that the types are correctly mapped.
102102

103103
```sql
104-
CREATE EXTERNAL TABLE <your_table_name>
104+
CREATE EXTERNAL TABLE [<your_table_name>]
105105
(
106-
<col1_name> DECIMAL(38) NOT NULL,
107-
<col2_name> DECIMAL(38) NOT NULL,
108-
<col3_name> CHAR COLLATE Latin1_General_BIN NOT NULL
106+
[<col1_name>] DECIMAL(38) NOT NULL,
107+
[<col2_name>] DECIMAL(38) NOT NULL,
108+
[<col3_name>] CHAR COLLATE Latin1_General_BIN NOT NULL
109109
)
110110
WITH (
111111
LOCATION='<sap_table_name>',
112-
DATA_SOURCE= <external_data_source_name>
112+
DATA_SOURCE= [<external_data_source_name>]
113113
)
114114
;
115115
```

docs/relational-databases/stored-procedures/delete-a-stored-procedure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-s
8080
5. Copy and paste the following example into the query editor and insert a stored procedure name to delete from the current database.
8181

8282
```sql
83-
DROP PROCEDURE <stored procedure name>;
83+
DROP PROCEDURE [<stored procedure name>];
8484
GO
8585
```
8686

docs/relational-databases/tables/manage-retention-of-historical-data-in-system-versioned-temporal-tables.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ See also:
9595
You can also use Transact-SQL to enable Stretch on the local server and [Enable Stretch Database for a database](../../sql-server/stretch-database/enable-stretch-database-for-a-database.md). You can then [use Transact-SQL to enable Stretch Database on a table](../../sql-server/stretch-database/enable-stretch-database-for-a-table.md). With a database previously enabled for Stretch Database, execute the following Transact-SQL script to stretch an existing system-versioned temporal history table:
9696

9797
```sql
98-
ALTER TABLE <history table name>
98+
ALTER TABLE [<history table name>]
9999
SET (REMOTE_DATA_ARCHIVE = ON (MIGRATION_STATE = OUTBOUND));
100100
```
101101

@@ -115,7 +115,7 @@ RETURN SELECT 1 AS is_eligible
115115
Next, use the following script to add the filter predicate to the history table and set the migration state to OUTBOUND to enable predicate based data migration for the history table.
116116

117117
```sql
118-
ALTER TABLE <history table name>
118+
ALTER TABLE [<history table name>]
119119
SET (
120120
REMOTE_DATA_ARCHIVE = ON
121121
(
@@ -192,7 +192,7 @@ The detailed steps for the recurring partition maintenance tasks are:
192192
1. SWITCH OUT: Create a staging table and then switch a partition between the history table and the staging table using the [ALTER TABLE &#40;Transact-SQL&#41;](../../t-sql/statements/alter-table-transact-sql.md) statement with the SWITCH PARTITION argument (see Example C. Switching partitions between tables).
193193

194194
```sql
195-
ALTER TABLE <history table> SWITCH PARTITION 1 TO <staging table>
195+
ALTER TABLE [<history table>] SWITCH PARTITION 1 TO [<staging table>]
196196
```
197197

198198
After the partition switch, you can optionally archive the data from staging table and then either drop or truncate the staging table to be ready for the next time you need to perform this recurring partition maintenance task.
@@ -440,7 +440,7 @@ FROM sys.databases
440440
Database flag **is_temporal_history_retention_enabled** is set to ON by default, but users can change it with ALTER DATABASE statement. It is also automatically set to OFF after point in time restore operation. To enable temporal history retention cleanup for your database, execute the following statement:
441441
442442
```sql
443-
ALTER DATABASE <myDB>
443+
ALTER DATABASE [<myDB>]
444444
SET TEMPORAL_HISTORY_RETENTION ON
445445
```
446446

docs/sql-server/stretch-database/disable-stretch-database-and-bring-back-remote-data.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ ms.custom: seo-dt-2019
5959
This command can't be canceled.
6060

6161
```sql
62-
USE <Stretch-enabled database name>;
62+
USE [<Stretch-enabled database name>];
6363
GO
64-
ALTER TABLE <Stretch-enabled table name>
64+
ALTER TABLE [<Stretch-enabled table name>]
6565
SET ( REMOTE_DATA_ARCHIVE ( MIGRATION_STATE = INBOUND ) ) ;
6666
GO
6767
```
@@ -98,7 +98,7 @@ ms.custom: seo-dt-2019
9898
Run the following command.
9999

100100
```sql
101-
ALTER DATABASE <Stretch-enabled database name>
101+
ALTER DATABASE [<Stretch-enabled database name>]
102102
SET REMOTE_DATA_ARCHIVE = OFF ;
103103
GO
104104
```

docs/sql-server/stretch-database/enable-stretch-database-for-a-database.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ GO
9393
Here's an example that creates a new credential.
9494
9595
```sql
96-
CREATE DATABASE SCOPED CREDENTIAL <db_scoped_credential_name>
96+
CREATE DATABASE SCOPED CREDENTIAL [<db_scoped_credential_name>]
9797
WITH IDENTITY = '<identity>' , SECRET = '<secret>' ;
9898
GO
9999
```
@@ -117,11 +117,11 @@ GO
117117
2. Provide an existing administrator credential with the CREDENTIAL argument, or specify FEDERATED_SERVICE_ACCOUNT = ON. The following example provides an existing credential.
118118
119119
```sql
120-
ALTER DATABASE <database name>
120+
ALTER DATABASE [<database name>]
121121
SET REMOTE_DATA_ARCHIVE = ON
122122
(
123123
SERVER = '<server_name>' ,
124-
CREDENTIAL = <db_scoped_credential_name>
124+
CREDENTIAL = [<db_scoped_credential_name>]
125125
) ;
126126
GO
127127
```

docs/sql-server/stretch-database/enable-stretch-database-for-a-table.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,19 @@ ms.custom: seo-dt-2019
7575
Here's an example that migrates the entire table and begins data migration immediately.
7676

7777
```sql
78-
USE <Stretch-enabled database name>;
78+
USE [<Stretch-enabled database name>];
7979
GO
80-
ALTER TABLE <table name>
80+
ALTER TABLE [<table name>]
8181
SET ( REMOTE_DATA_ARCHIVE = ON ( MIGRATION_STATE = OUTBOUND ) ) ;
8282
GO
8383
```
8484

8585
Here's an example that migrates only the rows identified by the `dbo.fn_stretchpredicate` inline table-valued function and postpones data migration. For more info about the filter function, see [Select rows to migrate by using a filter function](../../sql-server/stretch-database/select-rows-to-migrate-by-using-a-filter-function-stretch-database.md).
8686

8787
```sql
88-
USE <Stretch-enabled database name>;
88+
USE [<Stretch-enabled database name>];
8989
GO
90-
ALTER TABLE <table name>
90+
ALTER TABLE [<table name>]
9191
SET ( REMOTE_DATA_ARCHIVE = ON (
9292
FILTER_PREDICATE = dbo.fn_stretchpredicate(),
9393
MIGRATION_STATE = PAUSED ) ) ;
@@ -102,21 +102,27 @@ ALTER TABLE <table name>
102102
Here's an example that migrates the entire table and begins data migration immediately.
103103

104104
```sql
105-
USE <Stretch-enabled database name>;
105+
USE [<Stretch-enabled database name>];
106106
GO
107-
CREATE TABLE <table name>
108-
( ... )
107+
CREATE TABLE [<table name>]
108+
(
109+
col1 int
110+
/* replace the sample "col1" column shown above, with the actual list of columns */
111+
)
109112
WITH ( REMOTE_DATA_ARCHIVE = ON ( MIGRATION_STATE = OUTBOUND ) ) ;
110113
GO
111114
```
112115

113116
Here's an example that migrates only the rows identified by the `dbo.fn_stretchpredicate` inline table-valued function and postpones data migration. For more info about the filter function, see [Select rows to migrate by using a filter function](../../sql-server/stretch-database/select-rows-to-migrate-by-using-a-filter-function-stretch-database.md).
114117

115118
```sql
116-
USE <Stretch-enabled database name>;
119+
USE [<Stretch-enabled database name>];
117120
GO
118-
CREATE TABLE <table name>
119-
( ... )
121+
CREATE TABLE [<table name>]
122+
(
123+
col1 int
124+
/* replace the sample "col1" column shown above, with the actual list of columns */
125+
)
120126
WITH ( REMOTE_DATA_ARCHIVE = ON (
121127
FILTER_PREDICATE = dbo.fn_stretchpredicate(),
122128
MIGRATION_STATE = PAUSED ) ) ;

docs/sql-server/stretch-database/manage-and-troubleshoot-stretch-database.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,12 @@ If you have accidentally deleted columns from the remote table, run **sp_rda_rec
109109
For example, the following query returns local results only.
110110

111111
```sql
112-
USE <Stretch-enabled database name>;
112+
USE [<Stretch-enabled database name>];
113113
GO
114-
SELECT * FROM <Stretch_enabled table name> WITH (REMOTE_DATA_ARCHIVE_OVERRIDE = LOCAL_ONLY) WHERE ... ;
114+
SELECT *
115+
FROM [<Stretch_enabled table name>]
116+
WITH (REMOTE_DATA_ARCHIVE_OVERRIDE = LOCAL_ONLY)
117+
WHERE someCol = 1 /* sample predicate only, please replace with an appropriate one */ ;
115118
GO
116119
```
117120

docs/sql-server/stretch-database/pause-and-resume-data-migration-stretch-database.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ ms.custom: seo-dt-2019
3434
Run the following command.
3535

3636
```sql
37-
USE <Stretch-enabled database name>;
37+
USE [<Stretch-enabled database name>];
3838
GO
39-
ALTER TABLE <Stretch-enabled table name>
39+
ALTER TABLE [<Stretch-enabled table name>]
4040
SET ( REMOTE_DATA_ARCHIVE ( MIGRATION_STATE = PAUSED ) ) ;
4141
GO
4242
```
@@ -53,11 +53,11 @@ GO
5353
Run the following command.
5454

5555
```sql
56-
USE <Stretch-enabled database name>;
56+
USE [<Stretch-enabled database name>];
5757
GO
58-
ALTER TABLE <Stretch-enabled table name>
58+
ALTER TABLE [<Stretch-enabled table name>]
5959
SET ( REMOTE_DATA_ARCHIVE ( MIGRATION_STATE = OUTBOUND ) ) ;
60-
GO
60+
GO
6161
```
6262

6363
## Check whether migration is active or paused

docs/sql-server/stretch-database/select-rows-to-migrate-by-using-a-filter-function-stretch-database.md

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ RETURN SELECT 1 AS is_eligible
5656
### Conditions
5757
The &lt;*predicate*&gt; can consist of one condition, or of multiple conditions joined with the AND logical operator.
5858

59-
```
59+
```syntaxsql
6060
<predicate> ::= <condition> [ AND <condition> ] [ ...n ]
6161
```
6262

6363
Each condition in turn can consist of one primitive condition, or of multiple primitive conditions joined with the OR logical operator.
6464

65-
```
65+
```syntaxsql
6666
<condition> ::= <primitive_condition> [ OR <primitive_condition> ] [ ...n ]
6767
```
6868

6969
### Primitive conditions
7070
A primitive condition can do one of the following comparisons.
7171

72-
```
72+
```syntaxsql
7373
<primitive_condition> ::=
7474
{
7575
<function_parameter> <comparison_operator> constant
@@ -94,7 +94,7 @@ RETURN SELECT 1 AS is_eligible
9494

9595
ALTER TABLE stretch_table_name SET ( REMOTE_DATA_ARCHIVE = ON (
9696
FILTER_PREDICATE = dbo.fn_stretchpredicate(date),
97-
MIGRATION_STATE = OUTBOUND
97+
MIGRATION_STATE = OUTBOUND
9898
) )
9999

100100
```
@@ -126,7 +126,7 @@ RETURN SELECT 1 AS is_eligible
126126
127127
`<, <=, >, >=, =, <>, !=, !<, !>`
128128
129-
```
129+
```syntaxsql
130130
<comparison_operator> ::= { < | <= | > | >= | = | <> | != | !< | !> }
131131
```
132132
@@ -152,9 +152,8 @@ RETURN SELECT 1 AS is_eligible
152152
```sql
153153
ALTER TABLE stretch_table_name SET ( REMOTE_DATA_ARCHIVE = ON (
154154
FILTER_PREDICATE = dbo.fn_stretchpredicate(column1, column2),
155-
MIGRATION_STATE = <desired_migration_state>
156-
) )
157-
155+
MIGRATION_STATE = OUTBOUND /* replace OUTBOUND in this example, with the actual, desired migration state */
156+
) )
158157
```
159158

160159
After you bind the function to the table as a predicate, the following things are true.
@@ -199,7 +198,7 @@ If you want use a function that you can't create in the **Enable Database for St
199198
1. Reverse the direction of migration and bring back the data already migrated. You can't cancel this operation after it starts. You also incur costs on Azure for outbound data transfers (egress). For more info, see [How Azure pricing works](https://azure.microsoft.com/pricing/details/data-transfers/).
200199
201200
```sql
202-
ALTER TABLE <table name>
201+
ALTER TABLE [<table name>]
203202
SET ( REMOTE_DATA_ARCHIVE ( MIGRATION_STATE = INBOUND ) ) ;
204203
```
205204
@@ -210,11 +209,11 @@ If you want use a function that you can't create in the **Enable Database for St
210209
4. Add the function to the table and restart data migration to Azure.
211210
212211
```sql
213-
ALTER TABLE <table name>
212+
ALTER TABLE [<table name>]
214213
SET ( REMOTE_DATA_ARCHIVE
215214
(
216-
FILTER_PREDICATE = <predicate>,
217-
MIGRATION_STATE = OUTBOUND
215+
FILTER_PREDICATE = dbo.predicateFunction(col1) /* replace predicateFunction and col1 with the actual function call */
216+
,MIGRATION_STATE = OUTBOUND
218217
)
219218
);
220219
```
@@ -271,16 +270,15 @@ RETURN SELECT 1 AS is_eligible
271270
Apply the filter function to the table.
272271
273272
```sql
274-
ALTER TABLE <table name>
273+
ALTER TABLE [<table name>]
275274
SET (
276275
REMOTE_DATA_ARCHIVE = ON
277276
(
278-
FILTER_PREDICATE = dbo.fn_StretchBySystemEndTime20160101(SysEndTime)
277+
FILTER_PREDICATE = dbo.fn_StretchBySystemEndTime20160101(SysEndTime)
279278
, MIGRATION_STATE = OUTBOUND
280279
)
281280
)
282-
;
283-
281+
;
284282
```
285283
286284
When you want to update the sliding window, do the following things.
@@ -304,7 +302,7 @@ GO
304302
GO
305303
306304
/*(2) Set the new function as the filter predicate */
307-
ALTER TABLE <table name>
305+
ALTER TABLE [<table name>]
308306
SET
309307
(
310308
REMOTE_DATA_ARCHIVE = ON
@@ -313,8 +311,7 @@ GO
313311
MIGRATION_STATE = OUTBOUND
314312
)
315313
)
316-
COMMIT ;
317-
314+
COMMIT ;
318315
```
319316

320317
## More examples of valid filter functions
@@ -493,9 +490,8 @@ SELECT * FROM stretch_table_name CROSS APPLY fn_stretchpredicate(column1, column
493490
```sql
494491
ALTER TABLE stretch_table_name SET ( REMOTE_DATA_ARCHIVE = ON (
495492
FILTER_PREDICATE = dbo.fn_stretchpredicate2(column1, column2),
496-
MIGRATION_STATE = <desired_migration_state>
497-
) )
498-
493+
MIGRATION_STATE = OUTBOUND /* replace OUTBOUND in this example, with the actual, desired migration state */
494+
) )
499495
```
500496
501497
The new inline table-valued function has the following requirements.
@@ -589,7 +585,7 @@ GO
589585
```sql
590586
ALTER TABLE stretch_table_name SET ( REMOTE_DATA_ARCHIVE = ON (
591587
FILTER_PREDICATE = NULL,
592-
MIGRATION_STATE = <desired_migration_state>
588+
MIGRATION_STATE = OUTBOUND /* replace OUTBOUND in this example, with the actual, desired migration state */
593589
) )
594590
595591
```

0 commit comments

Comments
 (0)