Skip to content

Commit 6a9a052

Browse files
author
MightyPen
committed
Manual fixes of false-positives. json, xml.
1 parent c722fbd commit 6a9a052

5 files changed

Lines changed: 31 additions & 31 deletions

File tree

docs/t-sql/functions/json-value-transact-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ ORDER BY JSON_VALUE(jsonInfo,'$.info.address[0].town')
117117
### Example 2
118118
The following example extracts the value of the JSON property `town` into a local variable.
119119

120-
```syntaxsql
120+
```sql
121121
DECLARE @jsonInfo NVARCHAR(MAX)
122122
DECLARE @town NVARCHAR(32)
123123

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "TRANSLATE (Transact-SQL) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: 02/01/2019
4+
ms.date: 04/16/2020
55
ms.prod: sql
66
ms.prod_service: "sql-database"
77
ms.reviewer: ""
@@ -25,7 +25,7 @@ Returns the string provided as a first argument after some characters specified
2525

2626
## Syntax
2727

28-
```sql
28+
```syntaxsql
2929
TRANSLATE ( inputString, characters, translations)
3030
```
3131

@@ -60,21 +60,21 @@ This is dissimilar to the behavior of multiple `REPLACE` functions, as each func
6060

6161
The following query replaces square and curly braces in the input string with parentheses:
6262

63-
```syntaxsql
63+
```sql
6464
SELECT TRANSLATE('2*[3+4]/{7-2}', '[]{}', '()()');
6565
```
6666

6767
[!INCLUDE[ssResult_md](../../includes/ssresult-md.md)]
6868

69-
```plain_text
69+
```text
7070
2*(3+4)/(7-2)
7171
```
7272

7373
#### Equivalent calls to REPLACE
7474

7575
In the following SELECT statement, there is a group of four nested calls to the REPLACE function. This group is equivalent to the one call made to the TRANSLATE function in the preceding SELECT:
7676

77-
```syntaxsql
77+
```sql
7878
SELECT
7979
REPLACE
8080
(
@@ -103,7 +103,7 @@ REPLACE
103103

104104
GeoJSON is a format for encoding a variety of geographic data structures. With the `TRANSLATE` function, developers can easily convert GeoJSON points to WKT format and vice versa. The following query replaces square and curly braces in input with regular braces:
105105

106-
```syntaxsql
106+
```sql
107107
SELECT TRANSLATE('[137.4, 72.3]' , '[,]', '( )') AS Point,
108108
TRANSLATE('(137.4 72.3)' , '( )', '[,]') AS Coordinates;
109109
```

docs/t-sql/language-elements/else-if-else-transact-sql.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ IF Boolean_expression
5252
### A. Using a simple Boolean expression
5353
The following example has a simple Boolean expression (`1=1`) that is true and, therefore, prints the first statement.
5454

55-
```syntaxsql
55+
```sql
5656
IF 1 = 1 PRINT 'Boolean_expression is true.'
5757
ELSE PRINT 'Boolean_expression is false.' ;
5858
```
5959

6060
The following example has a simple Boolean expression (`1=2`) that is false, and therefore prints the second statement.
6161

62-
```syntaxsql
62+
```sql
6363
IF 1 = 2 PRINT 'Boolean_expression is true.'
6464
ELSE PRINT 'Boolean_expression is false.' ;
6565
GO
@@ -68,7 +68,7 @@ GO
6868
### B. Using a query as part of a Boolean expression
6969
The following example executes a query as part of the Boolean expression. Because there are 10 bikes in the `Product` table that meet the `WHERE` clause, the first print statement will execute. Change `> 5` to `> 15` to see how the second part of the statement could execute.
7070

71-
```
71+
```sql
7272
USE AdventureWorks2012;
7373
GO
7474
IF
@@ -81,7 +81,7 @@ GO
8181
### C. Using a statement block
8282
The following example executes a query as part of the Boolean expression and then executes slightly different statement blocks based on the result of the Boolean expression. Each statement block starts with `BEGIN` and completes with `END`.
8383

84-
```
84+
```sql
8585
USE AdventureWorks2012;
8686
GO
8787
DECLARE @AvgWeight decimal(8,2), @BikeCount int
@@ -113,7 +113,7 @@ GO
113113
### D. Using nested IF...ELSE statements
114114
The following example shows how an IF ... ELSE statement can be nested inside another. Set the `@Number` variable to `5`, `50`, and `500` to test each statement.
115115

116-
```
116+
```sql
117117
DECLARE @Number int;
118118
SET @Number = 50;
119119
IF @Number > 100
@@ -133,7 +133,7 @@ GO
133133
### E: Using a query as part of a Boolean expression
134134
The following example uses `IF...ELSE` to determine which of two responses to show the user, based on the weight of an item in the `DimProduct` table.
135135

136-
```
136+
```sql
137137
-- Uses AdventureWorks
138138

139139
DECLARE @maxWeight float, @productKey integer

docs/t-sql/statements/create-view-transact-sql.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "CREATE VIEW (Transact-SQL) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "10/10/2018"
4+
ms.date: 04/16/2020
55
ms.prod: sql
66
ms.prod_service: "database-engine, sql-database, sql-data-warehouse, pdw"
77
ms.reviewer: ""
@@ -204,7 +204,7 @@ OR ALTER
204204

205205
A partitioned view on `Server1` is defined in the following way:
206206

207-
```
207+
```sql
208208
--Partitioned view as defined on Server1
209209
CREATE VIEW Customers
210210
AS
@@ -223,7 +223,7 @@ FROM Server3.CompanyData.dbo.Customers_99;
223223

224224
Generally, a view is said to be a partitioned view if it is of the following form:
225225

226-
```
226+
```syntaxsql
227227
SELECT <select_list1>
228228
FROM T1
229229
UNION ALL
@@ -247,21 +247,21 @@ FROM Tn;
247247

248248
Constraint `C1` defined on table `T1` must be of the following form:
249249

250-
syntaxsql
250+
```syntaxsql
251251
C1 ::= < simple_interval > [ OR < simple_interval > OR ...]
252252
< simple_interval > :: =
253253
< col > { < | > | \<= | >= | = < value >}
254254
| < col > BETWEEN < value1 > AND < value2 >
255255
| < col > IN ( value_list )
256256
| < col > { > | >= } < value1 > AND
257257
< col > { < | <= } < value2 >
258-
syntaxsql
258+
```
259259
260260
- The constraints must be in such a way that any specified value of `<col>` can satisfy, at most, one of the constraints `C1, ..., Cn` so that the constraints form a set of disjointed or nonoverlapping intervals. The column `<col>` on which the disjointed constraints are defined is called the partitioning column. Note that the partitioning column may have different names in the underlying tables. The constraints must be in an enabled and trusted state for them to meet the previously mentioned conditions of the partitioning column. If the constraints are disabled, re-enable constraint checking by using the CHECK CONSTRAINT *constraint_name* option of ALTER TABLE, and using the WITH CHECK option to validate them.
261261
262262
The following examples show valid sets of constraints:
263263
264-
syntaxsql
264+
```syntaxsql
265265
{ [col < 10], [col between 11 and 20] , [col > 20] }
266266
{ [col between 11 and 20], [col between 21 and 30], [col between 31 and 100] }
267267
```
@@ -350,7 +350,7 @@ The following examples use the AdventureWorks 2012 or AdventureWorksDW database.
350350
### A. Using a simple CREATE VIEW
351351
The following example creates a view by using a simple `SELECT` statement. A simple view is helpful when a combination of columns is queried frequently. The data from this view comes from the `HumanResources.Employee` and `Person.Person` tables of the [!INCLUDE[ssSampleDBnormal](../../includes/sssampledbnormal-md.md)] database. The data provides name and hire date information for the employees of [!INCLUDE[ssSampleDBCoFull](../../includes/sssampledbcofull-md.md)]. The view could be created for the person in charge of tracking work anniversaries but without giving this person access to all the data in these tables.
352352
353-
```
353+
```sql
354354
CREATE VIEW hiredate_view
355355
AS
356356
SELECT p.FirstName, p.LastName, e.BusinessEntityID, e.HireDate
@@ -365,7 +365,7 @@ GO
365365

366366
**Applies to**: [!INCLUDE[ssKatmai](../../includes/sskatmai-md.md)] and later and [!INCLUDE[ssSDS](../../includes/sssds-md.md)].
367367

368-
```
368+
```sql
369369
CREATE VIEW Purchasing.PurchaseOrderReject
370370
WITH ENCRYPTION
371371
AS
@@ -381,7 +381,7 @@ GO
381381
### C. Using WITH CHECK OPTION
382382
The following example shows a view named `SeattleOnly` that references five tables and allows for data modifications to apply only to employees who live in Seattle.
383383

384-
```
384+
```sql
385385
CREATE VIEW dbo.SeattleOnly
386386
AS
387387
SELECT p.LastName, p.FirstName, e.JobTitle, a.City, sp.StateProvinceCode
@@ -402,7 +402,7 @@ GO
402402
### D. Using built-in functions within a view
403403
The following example shows a view definition that includes a built-in function. When you use functions, you must specify a column name for the derived column.
404404

405-
```
405+
```sql
406406
CREATE VIEW Sales.SalesPersonPerform
407407
AS
408408
SELECT TOP (100) SalesPersonID, SUM(TotalDue) AS TotalSales
@@ -416,7 +416,7 @@ GO
416416
### E. Using partitioned data
417417
The following example uses tables named `SUPPLY1`, `SUPPLY2`, `SUPPLY3`, and `SUPPLY4`. These tables correspond to the supplier tables from four offices, located in different countries/regions.
418418

419-
```
419+
```sql
420420
--Create the tables and insert the values.
421421
CREATE TABLE dbo.SUPPLY1 (
422422
supplyID INT PRIMARY KEY CHECK (supplyID BETWEEN 1 and 150),
@@ -463,7 +463,7 @@ GO
463463
### F. Creating a simple view
464464
The following example creates a view by selecting only some of the columns from the source table.
465465

466-
```
466+
```sql
467467
CREATE VIEW DimEmployeeBirthDates AS
468468
SELECT FirstName, LastName, BirthDate
469469
FROM DimEmployee;
@@ -472,7 +472,7 @@ FROM DimEmployee;
472472
### G. Create a view by joining two tables
473473
The following example creates a view by using a `SELECT` statement with an `OUTER JOIN`. The results of the join query populate the view.
474474

475-
```
475+
```sql
476476
CREATE VIEW view1
477477
AS
478478
SELECT fis.CustomerKey, fis.ProductKey, fis.OrderDateKey,

docs/t-sql/xml/query-method-xml-data-type.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "query() Method (xml Data Type) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "07/26/2017"
4+
ms.date: 04/16/2020
55
ms.prod: sql
66
ms.reviewer: ""
77
ms.technology: t-sql
@@ -22,7 +22,7 @@ Specifies an XQuery against an instance of the **xml** data type. The result is
2222

2323
## Syntax
2424

25-
```
25+
```syntaxsql
2626
2727
query ('XQuery')
2828
```
@@ -39,7 +39,7 @@ The following example declares a variable **\@myDoc** of **xml** type and assign
3939

4040
The query retrieves the <`Features`> child element of the <`ProductDescription`> element:
4141

42-
```
42+
```sql
4343
declare @myDoc xml
4444
set @myDoc = '<Root>
4545
<ProductDescription ProductID="1" ProductName="Road Bike">
@@ -64,7 +64,7 @@ The following output shows the result:
6464
### B. Using the query() method against an XML type column
6565
In the following example, the **query()** method is used to specify an XQuery against the **CatalogDescription** column of **xml** type in the **AdventureWorks** database:
6666

67-
```syntaxsql
67+
```sql
6868
SELECT CatalogDescription.query('
6969
declare namespace PD="https://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription";
7070
<Product ProductModelID="{ /PD:ProductDescription[1]/@ProductModelID }" />
@@ -94,7 +94,7 @@ The following output shows the partial result:
9494

9595
Note the query() and exist() methods both declare the PD prefix. In these cases, you can use WITH XMLNAMESPACES to first define the prefixes and use it in the query.
9696

97-
```syntaxsql
97+
```sql
9898
WITH XMLNAMESPACES
9999
(
100100
'https://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription' AS PD,

0 commit comments

Comments
 (0)