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

Is it crazy to launch online service dependent on connecting to Microsoft SQL via ODBC?

I have heard ODBC is very slow and we will be running several queries to see if the data is alreadu present

Is this a case of wrong tool since their is no DBI for MS SQL should we be using JDBC?

Just looking to see if anyone has actually rolled out any db dependant online apps based on ODBC


Cheers

Replies are listed 'Best First'.
Re: SQL Sever ODBC
by derby (Abbot) on Apr 03, 2003 at 13:39 UTC
Re: SQL Sever ODBC
by abhishes (Friar) on Apr 03, 2003 at 14:34 UTC

    You can use ADO to connect to MS Sql server.

    Here is a tutorial on how to use ADO to connect to ms sql server.

    regards,
    Abhishek.
      cheers guys I will do some tests using all of these Modules

      My question is are they good enough qulaity to be used on my website?

        ADO is A1 top fantastic. I would recommend it over raw ODBC any day, but it is only on Windows.

        Up to you.

Re: SQL Sever ODBC
by nite_man (Deacon) on Apr 03, 2003 at 12:16 UTC
Re: SQL Sever ODBC
by MrCromeDome (Deacon) on Apr 03, 2003 at 17:16 UTC
    In my experience, accessing SQL Server via ODBC in Perl is a bit hokey. Not undesireably slow, mind you, but for the sites I've had to use it for, I haven't had an extreme user load.

    It bears mentioning that my scripts do not use mod_perl though. I would expect there to be some performance gain there, but some of these scripts were written while I was still a baby Perl programmer, and I have not yet had the time to make them play nicely with mod_perl.

    That being said, I like the ODBC interface simply because I can port my scripts to *nix and only have to change my connection parameters in my app's config file. If you anticipate a heavy user load or performance hit, you may wish to consider the ADO route.

    Good luck!
    MrCromeDome

Re: SQL Server ODBC
by bilfurd (Hermit) on Apr 04, 2003 at 03:54 UTC
    A lot of good input here, but one more item to consider:

    How much data are you moving through ODBC?

    Unless you are expecting very large recordsets, you should be fine. If you are moving a lot of data (and the definition of "a lot" varies due to server hardware and traffic) you might consider moving to another protocol.

    I would recommend putting the database server to work, too. User defined functions and stored procedures are powerful tools, and you should be able to see if the data is already present by making just one call.

    Perl handles SQL Server via ODBC pretty well, too. During a database conversion project, I was getting better performance using Perl and ODBC than MS Access and ODBC performing the same tasks on the same data on the same SQL Server. It was not fast, it just took less time. (And yes, in this case, ODBC was a lot more effective than DTS.)

    Good luck!

Re: SQL Server ODBC
by aquarium (Curate) on Apr 04, 2003 at 11:10 UTC
    if you want speed then why use a MicroSlow database system? It's quite likely that MS SQL is chewing up so many resources on the server (just being there) that any additional work puts a stress on the server machine. If you can switch to a lightweight/fast DB server like mysql, then you can use whatever (ODBC/DBI) and see it fly. MS SQL server, Oracle and some other elephants are only meant for databases with needs like: automatic referential integrity checking/cascading, stored procedures, db scaling to several servers. I've seen these elephants used in situations where MS Access or DBase should have been used instead. So if you don't need an elephant, get a gazelle :) Chris Chris
      I am meant to be connecting our online services which are based on MySQL to our MS SQL CRM system which has been installed by a bunch of consultants.

      Of course said consultants have no idea about Perl or API's which means I have to find best way to connect

Re: SQL Server ODBC
by paulbort (Hermit) on Apr 04, 2003 at 15:23 UTC
    You didn't mention which OS you're running Perl on. Note that if you are trying to connect from Perl on *nix to MS-SQL, you will also need a TDS driver. I've had very good luck with FreeTDS connected to DBD::Sybase. (And when I started on this journey, I didn't even know that was possible. :-)

    --
    Spring: Forces, Coiled Again!