Writing a SQL Query in Active Record?
by Anukul Singhal other posts by this author
May 8 2008 8:16AM messages near this date
Re: Compilation error in cont.c
|
Re: Writing a SQL Query in Active Record?
Hi,
I am using the following code snippet for connecting to SQL Server
through Active Record:
require 'rubygems'
require 'active_record'
ActiveRecord::Base.establish_connection(
:adapter => "sqlserver",
:host => "xxx.xxx.xxx.xxx,8080"
:username => "username"
:password => "password"
:database => "xyz_1008"
)
Now, I want to execute a query in this sql server after getting
successfully connected but am not aware how to do so. Can anyone give an
example as to how we write the query say ("Select * from Name") after
establishing the above connection successfully?
Thanks,
Anukul
--
Posted via http://www.ruby-forum.com/.
Thread:
Anukul Singhal
Phillip Gawlowski
Simon Krahnke
Phillip Gawlowski
Anukul Singhal
Phillip Gawlowski
|