You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[!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.
45
43
46
44
[Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
47
45
@@ -61,15 +59,16 @@ ms.workload: "On Demand"
61
59
62
60
## Remarks
63
61
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
+
67
63
## 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.
69
68
70
69
```
71
70
SELECT 'abc\
72
-
def' AS ColumnResult;
71
+
def' AS [ColumnResult];
73
72
74
73
```
75
74
@@ -80,13 +79,31 @@ def' AS ColumnResult;
80
79
------------
81
80
abcdef
82
81
```
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.
0 commit comments