title: SQL Server : count of values stored in a multiple values holding parameter
body: <p>I have a parameter which holds an alternating amount of values inside. In some cases it has only one value, which is empty and I need to identify these situations.</p>
  
  <p>Here's a simplified example of what I've tried:</p>
  
  <pre><code>SELECT Id, Name, City
  FROM Example
  HAVING ((City IN @Cities) OR @Cities = '')
  </code></pre>
  
  <p>Where <code>@Cities</code> is a parameter holding multiple values (city names). The example crashes if <code>@Cities</code> has multiple values. <code>IS NULL</code> and <code>IS EMPTY</code> also result in as a crash</p>
  
  <p>I'm looking for a query that returns the whole database when the parameter has no values. The project a SSRS report and I'm using SQL Server 2012 and Visual Studio 2010.</p>