diff --git a/lib/arjdbc/mssql/adapter.rb b/lib/arjdbc/mssql/adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/arjdbc/mssql/adapter.rb
+++ b/lib/arjdbc/mssql/adapter.rb
@@ -87,7 +87,7 @@ module ::ArJdbc
       def type_cast(value)
         return nil if value.nil? || value == "(null)" || value == "(NULL)"
         case type
-        when :integer then unquote(value).to_i rescue value ? 1 : 0
+        when :integer then value.to_i rescue unquote(value).to_i rescue value ? 1 : 0
         when :primary_key then value == true || value == false ? value == true ? 1 : 0 : value.to_i
         when :decimal   then self.class.value_to_decimal(unquote(value))
         when :datetime  then cast_to_datetime(value)
mssql\adapter.rb: type_cast should try 'to_i' for integer columns before unquoting it - which uses to_s