title: About 'CASE' a conversion failure
body: <p>While using '<code>CASE</code>' I encountered with problem that I'D never heard.<br>
  The problem is so: I'M using '<code>CASE</code>' statement in '<code>SELECT</code>' clause as a field. When calling columns with int data type, it's successful; However, When calling a varchar or datetime, it's unsuccessful.<br>
  İn the error result, it's said me to have marked the temporary field, including '<code>CASE</code>' statement, as <code>int</code>, But not so. Please help...    </p>
  
  <blockquote>
    <p>The 'STORED PROCEDURE' Content  </p>
  </blockquote>
  
  <pre><code>CREATE PROC spRegistry_PersonsGetField
  @ID int,
  @Field varchar(100)
  AS
  SELECT CASE @Field 
  WHEN 'Name' THEN Name
  WHEN 'Surname' THEN Surname
  WHEN 'Username' THEN Username
  WHEN 'Password' THEN Password
  WHEN 'Status' THEN dbo.fnStatus(Status)
  WHEN 'EMail' THEN EMail
  WHEN 'Tel' THEN dbo.fnIsEmpty(Tel)
  WHEN 'Address' THEN dbo.fnIsEmpty(Address)
  WHEN 'City' THEN dbo.fnIsEmpty(City)
  WHEN 'BirthDate' THEN dbo.fnDate(BirthDate)
  WHEN 'Gender' THEN dbo.fnGender(Gender)
  WHEN 'Lang' THEN Lang
  ELSE NULL
  END
  AS [Alan] varchar(200)
  FROM Registry_Persons
  WHERE ID = @ID
  </code></pre>
  
  <p>My Query</p>
  
  <blockquote>
    <p>EXEC spRegistry_PersonsGetField 1, 'BirthDate'  </p>
  </blockquote>
  
  <p>The Error Message</p>
  
  <blockquote>
    <p>Conversion failed when converting the varchar value '04/11/2011' to data type int.</p>
  </blockquote>