title: Find index of last occurrence of a sub-string using T-SQL
body: <p>Is there a straightforward way of finding the index of the last occurrence of a string using SQL?  I am using SQL Server 2000 right now.  I basically need the functionality that the .NET <code>System.String.LastIndexOf</code> method provides.  A little googling revealed this - <a href="http://www.sqlservercentral.com/scripts/T-SQL+Aids/31116/" rel="noreferrer">Function To Retrieve Last Index</a> - but that does not work if you pass in a "text" column expression.  Other solutions found elsewhere work only so long as the text you are searching for is 1 character long.</p>
  
  <p>I will probably have to cook a function up.  If I do so, I will post it here so you folks can look at it and maybe make use of.</p>