I've recently installed this adapter in hope that I can work with utf-8
encoding using the SQL Server nvarchar data type.  I've installed and
followed the steps detailed at this uri:
http://github.com/adzap/rails-sqlserver-adapter/tree/master

I have this following migration class definition:
class CreateContacts < ActiveRecord::Migration
    def self.up
          create_table :contacts do |t|
            t.column :organization_id, :integer, :null=>false
            t.column :first_name, :nvarchar, :limit=>10, :null=>false
            t.column :last_name, :nvarchar, :null=>false
            t.column :title, :string
            t.column :contact_type_id, :integer, :null=>false
            t.column :fax, :string
            t.timestamps
        end
    end

    def self.down
        drop_table :contacts
    end
end


When I look at the generated table definition first_name column is
created has a length of 2 rather than 10.  In fact all of the columns of
type :nvarchar get a length of 2.  If I try what the web site
documentation has, namely:

t.column :body2_utf8,     :nvarchar_max   # Creates nvarchar(max)
or in my case:
t.column :first_name, :nvarchar_max, :null=>false

I get an error that says:
DBI::DatabaseError: Execute
    OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server
      Column, parameter, or variable #3: Cannot find data type
nvarchar_max.
    HRESULT error code:0x80020009

Does anyone know how I can set the maximum length of the nvarchar data
type successfully?

Thanks in advance, Calvin.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to