title: Using T-SQL, return nth delimited element from a string
body: <p>I have a need to create a function the will return nth element of a delimited string. </p>
  
  <p>For a data migration project, I am converting JSON audit records stored in a SQL Server database into a structured report using SQL script.  Goal is to deliver a sql script and a sql function used by the script without any code.  </p>
  
  <p>(This is a short-term fix will be used while a new auditing feature is added the ASP.NET/MVC application)</p>
  
  <p>There is no shortage of delimited string to table examples available.
  I've chosen a Common Table Expression example <a href="http://www.sqlperformance.com/2012/07/t-sql-queries/split-strings" rel="noreferrer">http://www.sqlperformance.com/2012/07/t-sql-queries/split-strings</a></p>
  
  <p>Example: I want to return 67 from '1,222,2,67,888,1111'  </p>