Skip to content

Commit dd8e79f

Browse files
authored
Merge pull request #17582 from icoric/icoric-patch-10
Sql colorizer updates
2 parents 4a8eef0 + e85c774 commit dd8e79f

77 files changed

Lines changed: 633 additions & 672 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/t-sql/language-elements/add-equals-transact-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-s
3333

3434
## Syntax
3535

36-
```
36+
```syntaxsql
3737
expression += expression
3838
```
3939

docs/t-sql/language-elements/add-transact-sql.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-s
3636

3737
## Syntax
3838

39-
```
39+
```syntaxsql
4040
expression + expression
4141
```
4242

@@ -54,7 +54,7 @@ expression + expression
5454
### A. Using the addition operator to calculate the total number of hours away from work for each employee.
5555
This example finds the total number of hours away from work for each employee by adding the number of hours taken for vacation and the number of hours taken as sick leave.
5656

57-
```
57+
```sql
5858
-- Uses AdventureWorks
5959

6060
SELECT p.FirstName, p.LastName, VacationHours, SickLeaveHours,
@@ -68,10 +68,9 @@ GO
6868
### B. Using the addition operator to add days to date and time values
6969
This example adds a number of days to a `datetime` date.
7070

71-
```
72-
71+
```sql
7372
SET NOCOUNT ON
74-
DECLARE @startdate datetime, @adddays int;
73+
DECLARE @startdate DATETIME, @adddays INT;
7574
SET @startdate = 'January 10, 1900 12:00 AM';
7675
SET @adddays = 5;
7776
SET NOCOUNT OFF;
@@ -92,8 +91,8 @@ Start Date Add Date
9291
### C. Adding character and integer data types
9392
The following example adds an **int** data type value and a character value by converting the character data type to **int**. If a character that is not valid exists in the **char** string, the [!INCLUDE[tsql](../../includes/tsql-md.md)] returns an error.
9493

95-
```
96-
DECLARE @addvalue int;
94+
```sql
95+
DECLARE @addvalue INT;
9796
SET @addvalue = 15;
9897
SELECT '125127' + @addvalue;
9998
```
@@ -112,7 +111,7 @@ SELECT '125127' + @addvalue;
112111
### D: Using the addition operator to calculate the total number of hours away from work for each employee
113112
The following example finds the total number of hours away from work for each employee by adding the number of hours taken for vacation and the number of hours taken as sick leave and sorts the results in ascending order.
114113

115-
```
114+
```sql
116115
-- Uses AdventureWorks
117116

118117
SELECT FirstName, LastName, VacationHours, SickLeaveHours,

docs/t-sql/language-elements/all-transact-sql.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ ms.author: jroth
3030
## Syntax
3131

3232
```syntaxsql
33-
3433
scalar_expression { = | <> | != | > | >= | !> | < | <= | !< } ALL ( subquery )
3534
```
3635

@@ -64,10 +63,10 @@ scalar_expression { = | <> | != | > | >= | !> | < | <= | !< } ALL ( subquery )
6463
## Examples
6564
The following example creates a stored procedure that determines whether all the components of a specified `SalesOrderID` in the [!INCLUDE[ssSampleDBnormal](../../includes/sssampledbnormal-md.md)] database can be manufactured in the specified number of days. The example uses a subquery to create a list of the number of `DaysToManufacture` values for all of the components of the specific `SalesOrderID`, and then confirms that all the `DaysToManufacture` are within the number of days specified.
6665

67-
```
66+
```sql
6867
-- Uses AdventureWorks
6968

70-
CREATE PROCEDURE DaysToBuild @OrderID int, @NumberOfDays int
69+
CREATE PROCEDURE DaysToBuild @OrderID INT, @NumberOfDays INT
7170
AS
7271
IF
7372
@NumberOfDays >= ALL
@@ -81,20 +80,19 @@ IF
8180
PRINT 'All items for this order can be manufactured in specified number of days or less.'
8281
ELSE
8382
PRINT 'Some items for this order can''t be manufactured in specified number of days or less.' ;
84-
8583
```
8684

8785
To test the procedure, execute the procedure by using the `SalesOrderID 49080`, which has one component requiring `2` days and two components that require 0 days. The first statement below meets the criteria. The second query doesn't.
8886

89-
```
87+
```sql
9088
EXECUTE DaysToBuild 49080, 2 ;
9189
```
9290

9391
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
9492

9593
`All items for this order can be manufactured in specified number of days or less.`
9694

97-
```
95+
```sql
9896
EXECUTE DaysToBuild 49080, 1 ;
9997
```
10098

docs/t-sql/language-elements/and-transact-sql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ boolean_expression AND boolean_expression
6363
### A. Using the AND operator
6464
The following example selects information about employees who have both the title of `Marketing Assistant` and more than `41` vacation hours available.
6565

66-
```
66+
```sql
6767
-- Uses AdventureWorks
6868

6969
SELECT BusinessEntityID, LoginID, JobTitle, VacationHours
@@ -75,7 +75,7 @@ AND VacationHours > 41 ;
7575
### B. Using the AND operator in an IF statement
7676
The following examples show how to use AND in an IF statement. In the first statement, both `1 = 1` and `2 = 2` are true; therefore, the result is true. In the second example, the argument `2 = 17` is false; therefore, the result is false.
7777

78-
```
78+
```sql
7979
IF 1 = 1 AND 2 = 2
8080
BEGIN
8181
PRINT 'First Example is TRUE'

docs/t-sql/language-elements/assignment-operator-transact-sql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-s
2727

2828
The equal sign (=) is the only [!INCLUDE[tsql](../../includes/tsql-md.md)] assignment operator. In the following example, the `@MyCounter` variable is created, and then the assignment operator sets `@MyCounter` to a value returned by an expression.
2929

30-
```
30+
```sql
3131
DECLARE @MyCounter INT;
3232
SET @MyCounter = 1;
3333
```
3434

3535
The assignment operator can also be used to establish the relationship between a column heading and the expression that defines the values for the column. The following example displays the column headings `FirstColumnHeading` and `SecondColumnHeading`. The string `xyz` is displayed in the `FirstColumnHeading` column heading for all rows. Then, each product ID from the `Product` table is listed in the `SecondColumnHeading` column heading.
3636

37-
```
37+
```sql
3838
-- Uses AdventureWorks
3939

4040
SELECT FirstColumnHeading = 'xyz',

docs/t-sql/language-elements/begin-distributed-transaction-transact-sql.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ ms.author: jroth
3939
## Syntax
4040

4141
```syntaxsql
42-
4342
BEGIN DISTRIBUTED { TRAN | TRANSACTION }
4443
[ transaction_name | @tran_name_variable ]
4544
[ ; ]
@@ -82,7 +81,7 @@ BEGIN DISTRIBUTED { TRAN | TRANSACTION }
8281
> [!NOTE]
8382
> Unless MS DTC is currently installed on the computer running the instance of the [!INCLUDE[ssDE](../../includes/ssde-md.md)], this example produces an error message. For more information about installing MS DTC, see the Microsoft Distributed Transaction Coordinator documentation.
8483
85-
```
84+
```sql
8685
USE AdventureWorks2012;
8786
GO
8887
BEGIN DISTRIBUTED TRANSACTION;

docs/t-sql/language-elements/begin-transaction-transact-sql.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ BEGIN TRANSACTION starts a local transaction for the connection issuing the stat
111111

112112
BEGIN TRAN *new_name* WITH MARK can be nested within an already existing transaction that is not marked. Upon doing so, *new_name* becomes the mark name for the transaction, despite the name that the transaction may already have been given. In the following example, `M2` is the name of the mark.
113113

114-
```
114+
```sql
115115
BEGIN TRAN T1;
116116
UPDATE table1 ...;
117117
BEGIN TRAN M2 WITH MARK;
@@ -146,7 +146,7 @@ COMMIT TRAN T1;
146146

147147
This example uses AdventureWorks.
148148

149-
```
149+
```sql
150150
BEGIN TRANSACTION;
151151
DELETE FROM HumanResources.JobCandidate
152152
WHERE JobCandidateID = 13;
@@ -158,9 +158,8 @@ COMMIT;
158158

159159
The following example shows the effect of rolling back a transaction. In this example, the ROLLBACK statement will roll back the INSERT statement, but the created table will still exist.
160160

161-
```
162-
163-
CREATE TABLE ValueTable (id int);
161+
```sql
162+
CREATE TABLE ValueTable (id INT);
164163
BEGIN TRANSACTION;
165164
INSERT INTO ValueTable VALUES(1);
166165
INSERT INTO ValueTable VALUES(2);
@@ -173,7 +172,7 @@ ROLLBACK;
173172

174173
The following example shows how to name a transaction.
175174

176-
```
175+
```sql
177176
DECLARE @TranName VARCHAR(20);
178177
SELECT @TranName = 'MyTransaction';
179178

@@ -191,7 +190,7 @@ GO
191190

192191
The following example shows how to mark a transaction. The transaction `CandidateDelete` is marked.
193192

194-
```
193+
```sql
195194
BEGIN TRANSACTION CandidateDelete
196195
WITH MARK N'Deleting a Job Candidate';
197196
GO

docs/t-sql/language-elements/bitwise-and-equals-transact-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-s
3434

3535
## Syntax
3636

37-
```
37+
```syntaxsql
3838
expression &= expression
3939
```
4040

docs/t-sql/language-elements/bitwise-and-transact-sql.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-s
3232

3333
## Syntax
3434

35-
```
35+
```syntaxsql
3636
expression & expression
3737
```
3838

@@ -60,7 +60,7 @@ expression & expression
6060
## Examples
6161
The following example creates a table using the **int** data type to store the values and inserts two values into one row.
6262

63-
```
63+
```sql
6464
CREATE TABLE bitwise (
6565
a_int_value INT NOT NULL,
6666
b_int_value INT NOT NULL);
@@ -71,7 +71,7 @@ GO
7171

7272
This query performs the bitwise AND between the `a_int_value` and `b_int_value` columns.
7373

74-
```
74+
```sql
7575
SELECT a_int_value & b_int_value
7676
FROM bitwise;
7777
GO

docs/t-sql/language-elements/bitwise-exclusive-or-equals-transact-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-s
3434

3535
## Syntax
3636

37-
```
37+
```syntaxsql
3838
expression ^= expression
3939
```
4040

0 commit comments

Comments
 (0)