title: Pass table as parameter into sql server UDF
body: <p>I'd like to pass a table as a parameter into a scaler UDF. </p>
  
  <p>I'd also prefer to restrict the parameter to tables with only one column. (optional)</p>
  
  <p>Is this possible?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I don't want to pass a table name, I'd like to pass the table of data (as a reference I presume)</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I would want my Scaler UDF to basically take a table of values and return a CSV list of the rows.</p>
  
  <p>IE</p>
  
  <pre><code>col1  
  "My First Value"  
  "My Second Value"
  ...
  "My nth Value"
  </code></pre>
  
  <p>would return</p>
  
  <pre><code>"My First Value, My Second Value,... My nth Value"
  </code></pre>
  
  <p>I'd like to do some filtering on the table though, IE ensuring that there are no nulls and to ensure there are no duplicates. I was expecting something along the lines of:</p>
  
  <pre><code>SELECT dbo.MyFunction(SELECT DISTINCT myDate FROM myTable WHERE myDate IS NOT NULL)
  </code></pre>