NotImplementedError on Azure SQL Database

211 views
Skip to first unread message

Gernot Bauer

unread,
Dec 10, 2012, 10:14:58 AM12/10/12
to rails-sqlse...@googlegroups.com
Hi!

I am trying to use the SQLServer Adapter in a Rails application with an Azure SQL Database. I am using Ubuntu 12.04 LTS, activerecord-sqlserver-adapter v3.1.7, tiny_tds v0.5.1 and FreeTDS from the Ubuntu repository (v.0.91-1). I succeeded in getting a connection by using a script similar to this one: https://groups.google.com/d/msg/rails-sqlserver-adapter/cgMSRVFlqE4/pv1F2ZqtbGwJ

However, when I try to run a Rake task (or the Rails application), I am getting the following error message upon DB connection:
Currently, only 2005, 2008, 2010 and 2011 are supported. We got back Microsoft SQL Azure (RTM) - 11.0.2154.0
        Nov 10 2012 01:09:45
        Copyright (c) Microsoft Corporation

My database.yml file looks like this (excerpt):
development:
  adapter: sqlserver
  mode: dblib
  dataserver:                                    # Name from freetds.conf, host or instance 'localhost\SQLEXPRESS'
  host: my_db_server.database.windows.net          # Used if dataserver is blank.
  port: 1433                                     # Used if host present. Default is 1433.
  database: my_db
  username: my_user@my_db
  password: my_pw
  timeout: 5000
  azure: true

A Google research didn't give me any clue about what is wrong here. Is there a problem with the Azure DB version?

I also want to state that I'm pretty new to Ruby and Rails and just working at migrating an existing app. So any help is kindly appreciated.

Kind Regards,
Gernot

Ken Collins

unread,
Dec 10, 2012, 10:37:53 AM12/10/12
to rails-sqlse...@googlegroups.com

Gernot Bauer

unread,
Dec 10, 2012, 12:35:38 PM12/10/12
to rails-sqlse...@googlegroups.com
Hi Ken,

Thanks for the links - I have already read them and I think that my Tiny TDS setup is correct since I can connect to the database and execute the query with my test script.

If I read the stacktrace correctly, the problem happens at creating the DB connection:
/home/gbauer/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-sqlserver-adapter-3.1.7/lib/active_record/connection_adapters/sqlserver_adapter.rb:220:in `initialize': Currently, only 2005, 2008, 2010 and 2011 are supported. We got back Microsoft SQL Azure (RTM) - 11.0.2154.0  (NotImplementedError)

        Nov 10 2012 01:09:45
        Copyright (c) Microsoft Corporation
.

But I think I managed to figure out the problem - it seems as if v3.1.7 of the activerecord-sqlserver-adapter does not support the 2012 version of an SQL Azure Server (at least this version is missing in the statement above, while it has been added on github for versions 3.2.0+).

Do you know if there are other changes regarding 2012 Server support besides the SUPPORTED_VERSIONS array on sqlserver_adapter.rb (as I'm currently tied to activerecord 3.1.x)?

Kind Regards,
Gernot

Ken Collins

unread,
Dec 10, 2012, 12:39:10 PM12/10/12
to rails-sqlse...@googlegroups.com

You will have to upgrade, 3.1 is not compatible with Azure. A Rails 3.1 to 3.2 is not that bad.

Either way, update Rails or reverse engineer the adapter differences between 3-1-stable, to 3-2-stable in the context of Azure.


- Ken

Gernot Bauer

unread,
Dec 10, 2012, 12:52:35 PM12/10/12
to rails-sqlse...@googlegroups.com
Ok, thanks for the advice!

Kind Regards,
Gernot

Patrick Dockhorn

unread,
Feb 7, 2013, 8:06:16 AM2/7/13
to rails-sqlse...@googlegroups.com
I got almost the same error...

Currently, only 2005, 2008, 2010, 2011, and 2012 are supported. We got back Microsoft SQL Azure (RTM) - 11.0.2224.11  (NotImplementedError)

using activerecord-sqlserver-adapter-3.2.10.

The same code had worked fine in December 2012 - and indeed all that was required to fix it was to add 2013 in sqlserver_adapter.rb :

SUPPORTED_VERSIONS = [2005,2008,2010,2011,2012,2013]

Patrick

Mario Franco

unread,
May 8, 2013, 2:10:13 AM5/8/13
to rails-sqlse...@googlegroups.com
Hi Patrick,

Im getting this: "Currently, only 2005, 2008, 2010, 2011, and 2012 are supported. We got back Microsoft SQL Azure (RTM) - 11.0.9042.76 
Apr 23 2013 16:46:08 
Copyright (c) Microsoft Corporation"

Can you tell me how to name the file, and exactly in what directory should I put it?

Thanks!
Reply all
Reply to author
Forward
0 new messages