Skip to content
This repository was archived by the owner on May 31, 2026. It is now read-only.

Commit c2d4c4a

Browse files
committed
more code
1 parent a9f7145 commit c2d4c4a

30 files changed

Lines changed: 317 additions & 326 deletions

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

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,14 @@ SELECT SYSDATETIME()
8585

8686
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
8787

88-
`SYSDATETIME() 2007-04-30 13:10:02.0474381`
89-
90-
`SYSDATETIMEOFFSET()2007-04-30 13:10:02.0474381 -07:00`
91-
92-
`SYSUTCDATETIME() 2007-04-30 20:10:02.0474381`
93-
94-
`CURRENT_TIMESTAMP 2007-04-30 13:10:02.047`
95-
96-
`GETDATE() 2007-04-30 13:10:02.047`
97-
98-
`GETUTCDATE() 2007-04-30 20:10:02.047`
88+
```
89+
SYSDATETIME() 2007-04-30 13:10:02.0474381
90+
SYSDATETIMEOFFSET()2007-04-30 13:10:02.0474381 -07:00
91+
SYSUTCDATETIME() 2007-04-30 20:10:02.0474381
92+
CURRENT_TIMESTAMP 2007-04-30 13:10:02.047
93+
GETDATE() 2007-04-30 13:10:02.047
94+
GETUTCDATE() 2007-04-30 20:10:02.047
95+
```
9996

10097
### B. Getting the current system date
10198

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,11 @@ SELECT LOG(10);
111111

112112
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
113113

114-
`----------------`
114+
```
115+
----------------`
115116
116-
`2.30`
117+
2.30
118+
```
117119

118120
### D. Calculating the logarithm of the exponent of a number
119121
The following example calculates the `LOG` for the exponent of a number.

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ SELECT LTRIM(' Five spaces are at the beginning of this string.') FROM sys.d
5959

6060
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
6161

62-
`---------------------------------------------------------------`
63-
`Five spaces are at the beginning of this string.`
62+
```
63+
---------------------------------------------------------------
64+
Five spaces are at the beginning of this string.
65+
```
6466

6567
### B: Example using a variable
6668

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,13 @@ GO
8888

8989
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
9090

91-
`-------------------`
91+
```
92+
-------------------
9293
93-
`5.00`
94+
5.00
9495
95-
`(1 row(s) affected)`
96+
(1 row(s) affected)
97+
```
9698

9799
### B. Using the OVER clause
98100
The following example uses the MIN, MAX, AVG and COUNT functions with the OVER clause to provide aggregated values for each department in the `HumanResources.Department` table in the [!INCLUDE[ssSampleDBnormal](../../includes/sssampledbnormal-md.md)] database.

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

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,16 @@ GO
7373

7474
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
7575

76-
`ProductID Name Color StandardCost`
77-
78-
`--------- ------------------- ------ ------------`
79-
80-
`984 Mountain-500 Silver, 40 Silver 308.2179`
81-
82-
`985 Mountain-500 Silver, 42 Silver 308.2179`
83-
84-
`986 Mountain-500 Silver, 44 Silver 308.2179`
85-
86-
`987 Mountain-500 Silver, 48 Silver 308.2179`
87-
88-
`988 Mountain-500 Silver, 52 Silver 308.2179`
89-
90-
`(6 row(s) affected)`
76+
```
77+
ProductID Name Color StandardCost
78+
--------- ------------------- ------ ------------
79+
984 Mountain-500 Silver, 40 Silver 308.2179
80+
985 Mountain-500 Silver, 42 Silver 308.2179
81+
986 Mountain-500 Silver, 44 Silver 308.2179
82+
987 Mountain-500 Silver, 48 Silver 308.2179
83+
988 Mountain-500 Silver, 52 Silver 308.2179
84+
(6 row(s) affected)
85+
```
9186

9287
## Examples: [!INCLUDE[ssSDWfull](../../includes/sssdwfull-md.md)] and [!INCLUDE[ssPDW](../../includes/sspdw-md.md)]
9388
The following example restricts results to `SalesOrderNumber` to values starting with `SO6` and `ProductKeys` greater than or equal to 400.

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,12 @@ WHERE Department = 'Quality Assurance'
7070

7171
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
7272

73-
`FirstName LastName Shift`
74-
75-
`------------ ---------------- -------`
76-
77-
`Andreas Berglund Evening`
78-
79-
`Sootha Charncherngkha Night`
73+
```
74+
FirstName LastName Shift
75+
------------ ---------------- -------
76+
Andreas Berglund Evening
77+
Sootha Charncherngkha Night
78+
```
8079

8180
## Examples: [!INCLUDE[ssSDWfull](../../includes/sssdwfull-md.md)] and [!INCLUDE[ssPDW](../../includes/sspdw-md.md)]
8281
The following example retrieves the names of employees who either earn a `BaseRate` less than 20 or have a `HireDate` January 1, 2001 or later.

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,10 @@ RAISERROR (15600,-1,-1, 'mysp_CreateCustomer');
138138

139139
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
140140

141-
`Msg 15600, Level 15, State 1, Line 1`
142-
`An invalid parameter or option was specified for procedure 'mysp_CreateCustomer'.`
141+
```
142+
Msg 15600, Level 15, State 1, Line 1
143+
An invalid parameter or option was specified for procedure 'mysp_CreateCustomer'.
144+
```
143145

144146
*state*
145147
Is an integer from 0 through 255. Negative values default to 1. Values larger than 255 should not be used.

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

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,13 @@ GO
106106

107107
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
108108

109-
`Return Status`
109+
```
110+
Return Status
110111
111-
`-------------`
112+
-------------
112113
113-
`1`
114+
1
115+
```
114116

115117
Execute the query again, specifying a different contact number.
116118

@@ -123,11 +125,12 @@ GO
123125

124126
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
125127

126-
`Return Status`
128+
```
129+
Return Status
130+
-------------
127131
128-
`-------------`
129-
130-
`2`
132+
2
133+
```
131134

132135
Execute the query again, specifying another contact number.
133136

@@ -140,11 +143,12 @@ GO
140143

141144
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
142145

143-
`Return Status`
144-
145-
`-------------`
146-
147-
`2`
146+
```
147+
Return Status
148+
-------------
149+
150+
2
151+
```
148152

149153
## See Also
150154
[ALTER PROCEDURE (Transact-SQL)](../../t-sql/statements/alter-procedure-transact-sql.md)

docs/t-sql/language-elements/string-concatenation-equal-transact-sql.md

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -93,39 +93,32 @@ GO
9393
```
9494
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
9595

96-
`Y `
96+
```
97+
Y
98+
-------
99+
8000
97100
98-
`-------`
99-
100-
`8000`
101-
102-
`(1 row(s) affected)`
101+
(1 row(s) affected)`
103102
104103
105-
`Y `
106-
107-
`-------`
104+
Y
105+
-------
106+
12000
108107
109-
`12000`
110-
111-
`(1 row(s) affected)`
108+
(1 row(s) affected)`
112109
113-
`Y `
114-
115-
`-------`
116-
117-
`8000`
118-
119-
`(1 row(s) affected)`
120-
121-
122-
`Y `
110+
Y
111+
-------
112+
8000
123113
124-
`-------`
114+
(1 row(s) affected)`
125115
126-
`8000`
116+
Y
117+
-------
118+
8000
127119
128-
`(1 row(s) affected)`
120+
(1 row(s) affected)
121+
```
129122

130123
## See Also
131124
[Operators (Transact-SQL)](../../t-sql/language-elements/operators-transact-sql.md)

docs/t-sql/language-elements/string-concatenation-transact-sql.md

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ GO
9696

9797
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
9898

99-
`------------------------------------------------`
100-
101-
`The order is due on 04/23/2007`
102-
103-
`(1 row(s) affected)`
99+
```
100+
------------------------------------------------
101+
The order is due on 04/23/2007
102+
(1 row(s) affected)
103+
```
104104

105105
### C. Using multiple string concatenation
106106
The following example concatenates multiple strings to form one long string to display the last name and the first initial of the vice presidents at [!INCLUDE[ssSampleDBCoFull](../../includes/sssampledbcofull-md.md)]. A comma is added after the last name and a period after the first initial.
@@ -119,17 +119,15 @@ GO
119119

120120
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
121121

122-
`Name Title`
123-
124-
`------------- ---------------`
125-
126-
`Duffy, T. Vice President of Engineering`
127-
128-
`Hamilton, J. Vice President of Production`
129-
130-
`Welcker, B. Vice President of Sales`
131-
132-
`(3 row(s) affected)`
122+
```
123+
Name Title
124+
------------- ---------------`
125+
Duffy, T. Vice President of Engineering
126+
Hamilton, J. Vice President of Production
127+
Welcker, B. Vice President of Sales
128+
129+
(3 row(s) affected)
130+
```
133131

134132
### D. Using large strings in concatenation
135133
The following example concatenates multiple strings to form one long string and then tries to compute the length of the final string. The final length of resultset is 16000, because expression evaluation starts from left that is, @x + @z + @y => (@x + @z) + @y. In this case the result of (@x + @z) is truncated at 8000 bytes and then @y is added to the resultset, which makes the final string length 16000. Since @y is a large value type string, truncation does not occur.
@@ -145,13 +143,13 @@ GO
145143
```
146144
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
147145

148-
`y `
149-
150-
`-------`
151-
152-
`16000`
146+
```
147+
y
148+
-------
149+
16000
153150
154-
`(1 row(s) affected)`
151+
(1 row(s) affected)
152+
```
155153
## Examples: [!INCLUDE[ssSDWfull](../../includes/sssdwfull-md.md)] and [!INCLUDE[ssPDW](../../includes/sspdw-md.md)]
156154

157155
### E. Using string concatenation

0 commit comments

Comments
 (0)