Hi, i''m migrating a web application from .NET (ASP+SQL Server) to
Rails and MySQL, but i''m still learning how to access SQL Server
database.
I''m writing a simple program using ActiveRecort (Stand Alone) to get
the data from SQL Server and insert it into the new database, but i
still couldn''t figure how to list SQL Server tables, here follows the
actual code:
#!/usr/bin/env ruby
require ''rubygems''
require_gem ''activerecord''
ActiveRecord::Base.establish_connection(
:adapter => "sqlserver",
:host => "10.1.1.6",
:username => "sa",
:password => "***",
:database => "jornaldedebates"
)
class Artigo < ActiveRecord::Base
set_table_name "Artigo"
end
artigo.find(:all).each {|artigo|
puts artigo
}
The SQL Server database "jornaldedebates" have an table called
"dbo.artigos", i still couldn''t get it, any ideas?
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---