# database migration

**URL:** <https://discuss.rubyonrails.org/t/database-migration/11069>\
**Category:** rubyonrails-talk\
**Created:** [March 31, 2007, 12:18pm UTC](https://discuss.rubyonrails.org/t/database-migration/11069 "2007-03-31T12:18:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paulo\_Geyer1](https://avatars.discourse-cdn.com/v4/letter/p/90ced4/32.png) [@Paulo\_Geyer1](https://discuss.rubyonrails.org/u/Paulo_Geyer1)\
**Post date:** [March 31, 2007, 12:18pm UTC](https://discuss.rubyonrails.org/t/database-migration/11069/1 "2007-03-31T12:18:29Z")

</div>

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 &nbsp;&nbsp;set\_table\_name "Artigo" end

artigo.find(:all).each {|artigo| &nbsp;&nbsp;puts artigo }

The SQL Server database "jornaldedebates" have an table called "dbo.artigos", i still couldn't get it, any ideas?
