title: Convert trims off leading zeros
body: <p>You'd think the two would both bring up the same result.  But this doesn't because the convert is trimming off the 2 zeros hence the 2nd doesn't return results as it's comparing 446641 to 446641</p>
  
  <pre><code>select memberID, 
              Photo as PhotoBlob 
      from    SomeTable
  WHERE memberId = '00446641'
  
  Select  memberID, 
          Photo as PhotoBlob 
  from    SomeTable
  WHERE memberId = convert(char(13), 00446641) - this is trimming off the 2 zeros
  </code></pre>
  
  <p>memberID for whatever odd reason isn't an int, it's a char(13) in that table</p>
  
  <p>UPDATE</p>
  
  <p>Here's the context:</p>
  
  <pre><code>public static MemberPhoto RetrieveMemberPhotoFromBlob(Int64 contractNumber)
  {
      Database db = DatabaseFactory.CreateDatabase(Config.DbConnectionString_MemberPhotos);
  
      using ( DbCommand cmd = db.GetSqlStringCommand(string.Format(@" Select  memberID, 
                                                                              Photo as PhotoBlob 
                                                                      from    SomeTable
                                                                      WHERE memberId = convert(char(13), @{0})","memberID")))
      {
          try
          {
              db.AddInParameter(cmd, "@contractNumber", DbType.Int64, contractNumber);
  </code></pre>