diff --git a/lib/active_record/connection_adapters/sqlserver_adapter.rb b/lib/active_record/connection_adapters/sqlserver_adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/active_record/connection_adapters/sqlserver_adapter.rb
+++ b/lib/active_record/connection_adapters/sqlserver_adapter.rb
@@ -311,6 +311,11 @@ module ActiveRecord
       end
 
       def type_to_sql(type, limit = nil, precision = nil, scale = nil) #:nodoc:
+        # Remove limit for data types which do not require it
+        # Valid:   ALTER TABLE sessions ALTER COLUMN [data] varchar(max)
+        # Invalid: ALTER TABLE sessions ALTER COLUMN [data] varchar(max)(16777215)
+        limit = nil if %w{text varchar(max) nvarchar(max) ntext varbinary(max) image}.include?(native_database_types[type.to_sym][:name])
+
         return super unless type.to_s == 'integer'
 
         if limit.nil?
Remove limit for data types which do not require it such as varchar(max) varbinary(max).