ptum has asked for the wisdom of the Perl Monks concerning the following question:

All of my Perl development has been on platforms running some form of Unix (mostly Solaris and Linux), connecting to Oracle or MySQL. We currently have a need to connect from our Solaris 5.9 servers to a MS SQL Server database controlled by another team.

Several suggestions that have been batted around internally include:

  1. Purchasing an ODBC driver and using DBD::ODBC.
  2. Connecting via DBD::Sybase using FreeTDS.
  3. Putting up an IIS webserver and using it to run a web service to translate queries from our servers.

Considerations:

While the purchase of an ODBC driver might seem the most straightforward solution, such things are often much more difficult bureaucratically than technically. As a contractor, I have no idea how to navigate the purchase order waters of my client company.

I ran into quite a bit of trouble getting the DBD-Sybase-1.07 and FreeTDS (0.63) libraries installed and have not yet found anyone who has been successful in using DBD::Sybase to connect to a MS SQL database from a Solaris platform. Has anyone out there been successful?

I have no experience with IIS.

I am very open to suggestions and recommendations.


No good deed goes unpunished. -- (attributed to) Oscar Wilde
  • Comment on How to connect to MS SQL Server from Unix

Replies are listed 'Best First'.
Re: How to connect to MS SQL Server from Unix
by Enlil (Parson) on Jan 16, 2006 at 19:33 UTC

      Looking at DBI::ProxyServer, it seems that this approach requires installation of ActiveState Perl and the DBI::ProxyServer piece on the Windows box, correct? While this is not an insurmountable problem, it is not as optimal as a solution which can be implemented entirely on servers under my control. Still, it would save me from having to purchase an ODBC driver -- thanks for the suggestion! :)

Re: How to connect to MS SQL Server from Unix
by traveler (Parson) on Jan 16, 2006 at 20:41 UTC
    When faced with a somewhat similar problem I chose to access the db via XML using HTTP. See this Microsoft article for more information. I had to get the IIS team to "turn on" this feature, but it was very simple, or so they said.

    It was easy to use perl to parse and manipulate the XML results.

Re: How to connect to MS SQL Server from Unix
by Anonymous Monk on Jan 16, 2006 at 21:02 UTC
    If you decide to consider ODBC ... 2 or 3 years ago I used ODBC-to-ODBC Bridge product for Unix to Windows for MS SQL Server (or other ODBC source defined on the Windows side). Good support for Perl DBD::ODBC module. This ODBC vendor knows about Perl, where another vendor only wanted to discuss C interface. http://www.easysoft.com/products/data_access/odbc_odbc_bridge/index.html Bill
Re: How to connect to MS SQL Server from Unix
by Anonymous Monk on Jan 17, 2006 at 06:33 UTC
Re: How to connect to MS SQL Server from Unix
by jplindstrom (Monsignor) on Jan 17, 2006 at 21:54 UTC
    I have used FreeTDS successfully from Linux, and I _think_ perhaps from Solaris as well (but I don't remember, that was several years ago).

    One thing I learned: configure the server as using TDS 4.2 in the TDS config.

    But if it's not possible, I'd just buy the ODBC driver. Consider the cost of development time and system complexity and stability of the third option... It's probably worth a bit of bureaucratic slalom. Try to make it a problem of a stakeholder inside the company :)

    /J