title: SQL Server parameterized SELECT procedure returns no result, but returns records when set explicitly
body: <p>I'm having problems with the following procedure</p>
  
  <pre><code>CREATE PROCEDURE [dbo].[Q2_05] (@Ch1 nvarchar, @Ch4 nvarchar, @globalOptionCode nvarchar)
  
  AS
  BEGIN
      SET NOCOUNT ON;
      SELECT [2_05].Ch1, [2_05].Ch4, [2_05].GlobalOption, [2_05].Part, [2_05].[Key]
      FROM [dbo.NV300Autostructure].[2_05]
      WHERE ((([2_05].Ch1)=@Ch1) AND (([2_05].Ch4)=@Ch4) AND (([2_05].GlobalOption)=@globalOptionCode));
  END
  </code></pre>
  
  <p>when I execute it with the following parameters ('5', 'TH', '.') it returns no results, but in the process of elimination I found that modifying the conditions line and set [2_05].Ch4 explicitly to 'TH' like so:</p>
  
  <pre><code>    WHERE ((([2_05].Ch1)=@Ch1) AND (([2_05].Ch4)='TH') AND (([2_05].GlobalOption)=@globalOptionCode));
  </code></pre>
  
  <p>it returns a row of the database. Why is that happening?</p>