Skip to content

Commit f6f4f16

Browse files
authored
added sql colorizers
1 parent 867173d commit f6f4f16

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

docs/t-sql/language-elements/unary-operators-negative.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-s
5656
### A. Setting a variable to a negative value
5757
The following example sets a variable to a negative value.
5858

59-
```
59+
```sql
6060
USE tempdb;
6161
GO
62-
DECLARE @MyNumber decimal(10,2);
62+
DECLARE @MyNumber DECIMAL(10,2);
6363
SET @MyNumber = -123.45;
6464
SELECT @MyNumber AS NegativeValue;
6565
GO
@@ -79,14 +79,13 @@ NegativeValue
7979
### B. Changing a variable to a negative value
8080
The following example changes a variable to a negative value.
8181

82-
```
82+
```sql
8383
USE tempdb;
8484
GO
85-
DECLARE @Num1 int;
85+
DECLARE @Num1 INT;
8686
SET @Num1 = 5;
8787
SELECT @Num1 AS VariableValue, -@Num1 AS NegativeValue;
8888
GO
89-
9089
```
9190

9291
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
@@ -105,7 +104,7 @@ VariableValue NegativeValue
105104
### C. Returning the negative of a positive constant
106105
The following example returns the negative of a positive constant.
107106

108-
```
107+
```sql
109108
USE ssawPDW;
110109

111110
SELECT TOP (1) - 17 FROM DimEmployee;
@@ -120,7 +119,7 @@ SELECT TOP (1) - 17 FROM DimEmployee;
120119
### D. Returning the positive of a negative constant
121120
The following example returns the positive of a negative constant.
122121

123-
```
122+
```sql
124123
USE ssawPDW;
125124

126125
SELECT TOP (1) - ( - 17) FROM DimEmployee;
@@ -135,7 +134,7 @@ SELECT TOP (1) - ( - 17) FROM DimEmployee;
135134
### E. Returning the negative of a column
136135
The following example returns the negative of the `BaseRate` value for each employee in the `dimEmployee` table.
137136

138-
```
137+
```sql
139138
USE ssawPDW;
140139

141140
SELECT - BaseRate FROM DimEmployee;

0 commit comments

Comments
 (0)