title: Finding Last Name of Hindi name from sql query(MS SQL)
body: <p>I have data base of eng and devnagri name like </p>
  
  <hr>
  
  <p><b>'PRABHU MATTHU RATHOD      | प्रभु मथथू राठोड'</b></p>
  
  <p>I am breaking these name as firstname ,middlename,lastname
  Eng name is properly working but for hindi name it is showing issue<br></p>
  
  <p>I have tried this to find last index of space in name <br></p>
  
  <pre><code>@MA_Name = प्रभु मथथू राठोड
  REVERSE(SUBSTRING(REVERSE(@MA_Name), 1,CHARINDEX(' ', REVERSE(@MA_Name)) - 1));
  </code></pre>
  
  <p><br> here it is failing <code>CHARINDEX(' ', REVERSE(@MA_Name)) - 1)</code> which is returning <code>-1</code>
  <br> I dont know why </p>