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

Dear Monks,

I have looked at a number of previous nodes and I am still not clear as to my best strategy. My background is Perl and MySQL in a Linux box. I have recently started a new job where they use MS SQL Server. I have set up ActivePerl on Win NT and can connect up to the database with Perl DBI in Win NT. I like the functionality of Linux and dream of accessing the MS SQL Server from a Linux box. I understand that this can be done, although it is not easy. The Linux box that I would get to do this would be a spec from 3 years ago. My windows machine is top of the range. Also, I may need to build up and update MS SQL tables from presently used MS Access databases. There is not software at present that I specifically have to use in Linux. Do people advise me that I stick with Active Perl and developing scripts with Perl DBI. to access both the Access and SQL server databases?

  • Comment on Linux and Win NT, MS SQL Server and MS Access, Perl

Replies are listed 'Best First'.
Re: Linux and Win NT, MS SQL Server and MS Access, Perl
by rdfield (Priest) on Nov 11, 2003 at 10:43 UTC
Re: Linux and Win NT, MS SQL Server and MS Access, Perl
by hmerrill (Friar) on Nov 11, 2003 at 13:26 UTC

    As rdfield already suggested, DBD::Proxy is one way to go.

    Usually when you're going to setup a database client machine, you need the database "client" software installed on the client machine first - then you install DBI and DBD::<your database>. For example if your database is MySQL, on a "client" machine, you would need to install the MySQL client software on the client machine first - then you would install DBD::mysql (DBI is required also, but is not dependent on the database client software already being installed).

    With DBD::Proxy, you don't need to install the database client software on the client machine - you would access the database through DBD::Proxy. We used DBD::Proxy in a previous job and it worked fine for us to access an Oracle database - it took us a while to set it up and get it working, but once it worked it ran without problem. The one question/concern that was posed on the dbi-users mailing list at the time was a question of performance on DBD::Proxy - if you are expecting very heavy usage of the database through DBD::Proxy, you *may* experience performance problems. Our use of the database through DBD::Proxy was pretty light, and we didn't see any performance issues with it.

    If I understand correctly, your database server is MS SQL on Win NT. Although I don't have any experience with it, I believe your other option would be to install DBI and DBD::ODBC on the Linux client box. I think(?) you can use that to access the MS SQL server on the WinNT box.

    HTH

Re: Linux and Win NT, MS SQL Server and MS Access, Perl
by mpeppler (Vicar) on Nov 11, 2003 at 15:47 UTC
    See the FreeTDS project, at www.freetds.org. With FreeTDS you can either use DBD::Sybase or DBD::ODBC.

    Michael

      With FreeTDS you can either use DBD::Sybase or DBD::ODBC

      I could be wrong, but wouldn't that only apply to MS SQL, not to Access?

Re: Linux and Win NT, MS SQL Server and MS Access, Perl
by jZed (Prior) on Nov 11, 2003 at 18:39 UTC
    As others have pointed out, if you have reasons to be on Linux, then DBD::Proxy is the way to go. But you would need to make this decision based on other criteria than what you've told us. If the only thing you're doing is DBI, then your scripts using ActivePerl + DBI will be essentially identical to your Linux + DBI scripts minus the DBD::Proxy stuff so there's nothing about DBI or your database interactions that will be magically improved by moving to Linux. Besides, given your nick, aren't you destined to use ActivePerl?