title: Creating a CLR UDF with variable number of parameters
body: <p>I wanted a function to find the greatest of a list of String values passed in.</p>
  
  <p>I want to invoke it as Select greatest('Abcd','Efgh','Zxy','EAD') from sql server.
  It should return Zxy.
  The number of parameters is variable.Incidentally it is very similar to 
  oracle GREATEST function.
  So I wrote a very simple CLR function (Vs2008) and tried to deploy it.
  See below</p>
  
  <pre><code>public partial class UserDefinedFunctions
  {
  [Microsoft.SqlServer.Server.SqlFunction]
  public static SqlString Greatest(params SqlString[] p)
  {
  SqlString max=p[0];
  foreach (string s in p)
  max = s.CompareTo(max) &gt; 0 ? s : max;
  
  return max;
  
  }
  };
  </code></pre>
  
  <p>But when I try to compile or deploy it I get the following error
  Cannot find data type SqlString[].</p>
  
  <p>Is it possible to satisfy my requirement using SQL CLR ?</p>