Active Record: Query to find all the tables in a database?

A

Anukul Singhal

Hi,

I am using the following code snippet to connect to a DB using Active
Record:

require 'rubygems'
require 'active_record'

ActiveRecord::Base.establish_connection(
:adapter => "sqlserver",
:host => "113.130.232.221,1342",
:username => "username",
:password => "password",
:database => "DIT_VW_1008"
)

It has about 25 tables. I want to print the names of all the tables in
the database "DIT_VW_1008". Can anyone provide the code to solve my
problem?

Thanks,
Anukul
 
P

Prabhas Gupte

[Note: parts of this message were removed to make it a legal post.]

just for confirmation, do this:
con = ActiveRecord::Base.establish
_connection(
:adapter => "sqlserver",
:host => "113.130.232.221,1342",
:username => "username",
:password => "password",
:database => "DIT_VW_1008"
)

print con.methods
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top