Skip to content

Commit 2b55edf

Browse files
authored
Merge pull request #212 from srutzky/SRutzky-CorrectFalseStatements-01
Correct false statements re: "Backslash" and fix title
2 parents ed1d8e1 + d3e7ade commit 2b55edf

2 files changed

Lines changed: 31 additions & 14 deletions

File tree

docs/t-sql/language-elements/TOC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# [CREATE DIAGNOSTICS SESSION](create-diagnostics-session-transact-sql.md)
55
# [NULL and UNKNOWN](null-and-unknown-transact-sql.md)
66
# [USE](use-transact-sql.md)
7-
# [Backslash](sql-server-utilities-statements-backslash.md)
7+
# [Backslash (Line Continuation)](sql-server-utilities-statements-backslash.md)
88
# [GO](sql-server-utilities-statements-go.md)
99

1010
# [Control-of-Flow](control-of-flow.md)

docs/t-sql/language-elements/sql-server-utilities-statements-backslash.md

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: "(Backslash) (Transact-SQL) | Microsoft Docs"
2+
title: "Backslash (Line Continuation) (Transact-SQL) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "07/27/2017"
4+
ms.date: "11/09/2017"
55
ms.prod: "sql-non-specified"
66
ms.reviewer: ""
77
ms.suite: ""
@@ -36,12 +36,10 @@ ms.author: "rickbyh"
3636
manager: "jhubbard"
3737
ms.workload: "On Demand"
3838
---
39-
# SQL Server Utilities Statements - Backslash
39+
# Backslash (Line Continuation) (Transact-SQL)
4040
[!INCLUDE[tsql-appliesto-ss2008-asdb-xxxx-xxx_md](../../includes/tsql-appliesto-ss2008-asdb-xxxx-xxx-md.md)]
4141

42-
[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] provides commands that are not [!INCLUDE[tsql](../../includes/tsql-md.md)] statements, but are recognized by the **sqlcmd** and **osql** utilities and [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] Code Editor. These commands can be used to facilitate the readability and execution of batches and scripts.
43-
44-
\ breaks a long string constant into two or more lines for readability.
42+
`\` breaks a long string constant, character or binary, into two or more lines for readability.
4543

4644
![Topic link icon](../../database-engine/configure-windows/media/topic-link.gif "Topic link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
4745

@@ -61,15 +59,16 @@ ms.workload: "On Demand"
6159

6260
## Remarks
6361
This command returns the first and continued sections of the string as one string, without the backslash.
64-
65-
The backslash is not a [!INCLUDE[tsql](../../includes/tsql-md.md)] statement. It is a command that is recognized by the **sqlcmd** and **osql** utilities and [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] Code Editor.
66-
62+
6763
## Examples
68-
The following example uses a backslash and a carriage return to split the string into two lines.
64+
65+
### A. Splitting a character string
66+
67+
The following example uses a backslash and a carriage return to split a character string into two lines.
6968

7069
```
7170
SELECT 'abc\
72-
def' AS ColumnResult;
71+
def' AS [ColumnResult];
7372
7473
```
7574

@@ -80,13 +79,31 @@ def' AS ColumnResult;
8079
------------
8180
abcdef
8281
```
82+
83+
### B. Splitting a binary string
84+
85+
The following example uses a backslash and a carriage return to split a binary string into two lines.
86+
87+
```
88+
SELECT 0xabc\
89+
def AS [ColumnResult];
8390
91+
```
92+
93+
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
94+
95+
```
96+
ColumnResult
97+
------------
98+
0xABCDEF
99+
```
100+
84101
## See Also
85102
[Data Types (Transact-SQL)](../../t-sql/data-types/data-types-transact-sql.md)
86103
[Built-in Functions (Transact-SQL)](~/t-sql/functions/functions.md)
87104
[Operators (Transact-SQL)](../../t-sql/language-elements/operators-transact-sql.md)
88-
[(Divide) (Transact-SQL)](../../t-sql/language-elements/divide-transact-sql.md)
89-
[(Divide EQUALS) (Transact-SQL)](../../t-sql/language-elements/divide-equals-transact-sql.md)
105+
[(Division) (Transact-SQL)](../../t-sql/language-elements/divide-transact-sql.md)
106+
[(Division Assignment) (Transact-SQL)](../../t-sql/language-elements/divide-equals-transact-sql.md)
90107
[Compound Operators (Transact-SQL)](../../t-sql/language-elements/compound-operators-transact-sql.md)
91108

92109

0 commit comments

Comments
 (0)