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?
Anukul S. wrote:
| 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?
You write with ease to show your breeding,
But easy writing 's curst hard reading.
~ – Richard Brinsley Sheridan (1751-1816)
~ – Clio’s Protest, Life of Sheridan (Moore), Vol. i, p. 155
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
Anukul S. wrote:
| 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?
You write with ease to show your breeding,
But easy writing 's curst hard reading.
~ – Richard Brinsley Sheridan (1751-1816)
~ – Clio’s Protest, Life of Sheridan (Moore), Vol. i, p. 155
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
~ How many boards would the Mongols hoard if the Mongol hordes got
bored?
– Calvin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
Simon K. wrote:
| * Anukul S. [email protected] (17:55) schrieb:
|
|> I am not using rails. Want to run the query only using Active Record on
|> Ruby (Scite Editor)
|
| What’s ActiveRecord for if you just want to use SQL?
Parenthesise to avoid ambiguity.
~ - The Elements of Programming Style (Kernighan & Plaugher)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org