title: What is the usage of '\' and '$' in T-SQL?
body: <p>As I found (in SQL Server books):</p>
  
  <blockquote>
    <p><strong><code>\ (Backslash) (Transact-SQL)</code></strong><br>
    Breaks a long string constant into two or more lines for readability.</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p><strong><code>SELECT Clause (Transact-SQL)</code></strong> ... <code>$IDENTITY | $ROWGUID</code><br>
    And<br>
    <strong><code>$PARTITION (Transact-SQL)</code></strong><br>
    Returns the partition number into which a set of partitioning column values would be mapped for any specified partition function. </p>
  </blockquote>
  
  <p>of usage of <code>\</code> and <code>$</code> in T-SQL specially SQL Server.</p>
  
  <p>Now, I have a query like this:</p>
  
  <pre><code>SELECT \ a, $ b, \11 c, $12 d;
  </code></pre>
  
  <p>That have a valid result like this:</p>
  
  <pre><code>a    | b    | c     | d 
  -----+------+-------+-------
  0.00 | 0.00 | 11.00 | 12.00
  </code></pre>
  
  <p>I think there is something that I can't find it about this characters.</p>
  
  <p><strong>Edit :</strong><br>
  I found that if a number comes after <a href="https://technet.microsoft.com/en-us/library/aa223952%28v=sql.80%29.aspx" rel="nofollow">currency symbols</a>, SQL Server will remove the defined symbol and store the value as a money data type:</p>
  
  <p>And I think, SQL Server translate a single currency symbol that is the last phrase in a part -these parts are between <code>+</code> and <code>-</code>- of formula to <code>0.00</code> and only at the end of the part like <code>-$</code>, <code>($)</code>, <code>(12 + $)</code>, <code>($) + 12</code>, <code>$ * (12 - $)</code> or so on, and not <code>$ + 1</code>, <code>2 * $ - 1</code>. Also I found <code>$   2</code> is same as <code>$2</code>.</p>
  
  <p>All above behavior is same for <code>\</code> that means SQL Server thinks <code>\</code> is a currency symbol!!!</p>