# Connection with MS SQL Server

**URL:** <https://www.ruby-forum.com/t/connection-with-ms-sql-server/194653>\
**Category:** Ruby\
**Created:** [September 8, 2010, 3:17pm UTC](https://www.ruby-forum.com/t/connection-with-ms-sql-server/194653 "2010-09-08T15:17:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stamppot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bcef8e/32.png) [@stamppot](https://www.ruby-forum.com/u/stamppot)\
**Post date:** [September 8, 2010, 3:17pm UTC](https://www.ruby-forum.com/t/connection-with-ms-sql-server/194653/1 "2010-09-08T15:17:09Z")

</div>

Hi,

I’m looking for a library which enables me to execute SQL statements on  
a MS SQL database server. The libs I found until now on the Net seemed  
to allow only SELECT statements, I need to to the following operations:

create table

select count…

drop table

rename table

Any hints appreciated very much!

Thanx  
Jens

---

<div class="post-metadata">

**Author:** ![stamppot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bcef8e/32.png) [@stamppot](https://www.ruby-forum.com/u/stamppot)\
**Post date:** [September 8, 2010, 11:22pm UTC](https://www.ruby-forum.com/t/connection-with-ms-sql-server/194653/2 "2010-09-08T23:22:35Z")

</div>

Hallo Jens,

You may use ruby-odbc ([ODBC Binding for Ruby](http://www.ch-werner.de/rubyodbc/))  
On Windows or on Linux together with FreeTDS  
You may also look at activerecord-sqlserver-adapter gem and their  
website for some hints for installing it.

Klaus

---

<div class="post-metadata">

**Author:** ![stamppot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bcef8e/32.png) [@stamppot](https://www.ruby-forum.com/u/stamppot)\
**Post date:** [September 10, 2010, 3:26pm UTC](https://www.ruby-forum.com/t/connection-with-ms-sql-server/194653/3 "2010-09-10T15:26:22Z")

</div>

Here’s a wiki I wrote a long time ago on setting up ruby on unix to with  
with sql server

> **[Connecting to SQL Server from Unix with Ruby](https://rubykata.wordpress.com/connecting-to-sql-server-from-unix-with-ruby/)**
>
> How to get Ruby on Rails (unix / mac) to work with SQL Server The bulk of this page is a variation of this Wiki Install ActiveRecord SQLServer adapater. sudo gem install activerecord-sqlserver-adap…
