looking for a good python module for MS SQL server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anat

    #1

    looking for a good python module for MS SQL server

    Hi,
    Does anyone know a good python mudule that works with MS SQL server?
    Thanks,
    Anat


  • Jarek Zgoda

    #2
    Re: looking for a good python module for MS SQL server

    Anat napisa³(a):
    [color=blue]
    > Does anyone know a good python mudule that works with MS SQL server?[/color]

    Google will yield something, but I prefer adodbapi over specialized
    modules. Works good with SQLServer using SSPI auth (others rather not).

    --
    Jarek Zgoda

    Comment

    • Brian

      #3
      Re: looking for a good python module for MS SQL server

      I've had good results with adodbapi as well.

      Comment

      • Steve Holden

        #4
        Re: looking for a good python module for MS SQL server

        Jarek Zgoda wrote:[color=blue]
        > Anat napisa³(a):
        >
        >[color=green]
        >>Does anyone know a good python mudule that works with MS SQL server?[/color]
        >
        >
        > Google will yield something, but I prefer adodbapi over specialized
        > modules. Works good with SQLServer using SSPI auth (others rather not).
        >[/color]
        Though it does have problems with stored procedures.

        regards
        Steve
        --
        Steve Holden +44 150 684 7255 +1 800 494 3119
        Holden Web LLC www.holdenweb.com
        PyCon TX 2006 www.python.org/pycon/

        Comment

        • Grig Gheorghiu

          #5
          Re: looking for a good python module for MS SQL server

          I successfully used mxODBC
          (<http://www.egenix.com/files/python/mxODBC.html>)

          Grig

          Comment

          • Frank Millman

            #6
            Re: looking for a good python module for MS SQL server


            Anat wrote:[color=blue]
            > Hi,
            > Does anyone know a good python mudule that works with MS SQL server?
            > Thanks,
            > Anat[/color]

            I use the odbc module from pywin32. I believe that it is not 100%
            DB-API 2.0 compliant, but it works fine for me. It has the advantage
            that if you have installed pywin32 (which is advisable on MSW anyway)
            you do not have to install anything else.

            I tried adodbapi a few years ago, and it seemed slow in returning
            results. I don't know if it has improved in the meantime.

            There is one thing I have not figured out how to do with MS-SQL - I
            would be interested if anyone has a solution. I use 'scrollable
            cursors' a lot. DB-API does not seem to define any methods to
            facilitate this, so I construct them and manage them myself with a
            series of cur.execute(... ) commands. PostgreSQL allows you to 'fetch'
            multiple rows at a time. MS-SQL in its normal mode does not. This is
            taken from the on-line help -

            "Transact-SQL cursors are limited to fetching one row at a time. API
            server cursors support fetching blocks of rows with each fetch. A
            cursor that supports fetching multiple rows at a time is called a block
            cursor."

            It goes on to say that API's which support block cursors are OLE DB,
            ODBC, ADO, and DB-Library, and that each one has its own syntax.

            Do adodbapi, mxODBC, or any other modules allow you to do this?

            Thanks

            Frank

            Comment

            • Jarek Zgoda

              #7
              Re: looking for a good python module for MS SQL server

              Steve Holden napisa³(a):
              [color=blue][color=green][color=darkred]
              >>> Does anyone know a good python mudule that works with MS SQL server?[/color]
              >>
              >> Google will yield something, but I prefer adodbapi over specialized
              >> modules. Works good with SQLServer using SSPI auth (others rather not).
              >>[/color]
              > Though it does have problems with stored procedures.[/color]

              Didn't discover any of these.

              --
              Jarek Zgoda

              Comment

              • Steve Holden

                #8
                Re: looking for a good python module for MS SQL server

                Jarek Zgoda wrote:[color=blue]
                > Steve Holden napisa³(a):
                >
                >[color=green][color=darkred]
                >>>>Does anyone know a good python mudule that works with MS SQL server?
                >>>
                >>>Google will yield something, but I prefer adodbapi over specialized
                >>>modules. Works good with SQLServer using SSPI auth (others rather not).
                >>>[/color]
                >>
                >>Though it does have problems with stored procedures.[/color]
                >
                >
                > Didn't discover any of these.
                >[/color]
                Maybe things have changes since I last used adodbapi - can you actually
                run stored procedures now?

                regards
                Steve
                --
                Steve Holden +44 150 684 7255 +1 800 494 3119
                Holden Web LLC www.holdenweb.com
                PyCon TX 2006 www.python.org/pycon/

                Comment

                • Jarek Zgoda

                  #9
                  Re: looking for a good python module for MS SQL server

                  Steve Holden napisa³(a):
                  [color=blue][color=green][color=darkred]
                  >>>>> Does anyone know a good python mudule that works with MS SQL server?
                  >>>>
                  >>>> Google will yield something, but I prefer adodbapi over specialized
                  >>>> modules. Works good with SQLServer using SSPI auth (others rather not).
                  >>>
                  >>> Though it does have problems with stored procedures.[/color]
                  >>
                  >> Didn't discover any of these.
                  >>[/color]
                  > Maybe things have changes since I last used adodbapi - can you actually
                  > run stored procedures now?[/color]

                  Things didn't change, as last update to adodbapi was long time ago... I
                  had no problems with stored procedures accessed using cursor's execute()
                  method (i.e. execute('exec sp_someproc, param')), but I never tried to
                  get any results, just call sp and commit or rollback.

                  --
                  Jarek Zgoda

                  Comment

                  • Steve Holden

                    #10
                    Re: looking for a good python module for MS SQL server

                    Jarek Zgoda wrote:[color=blue]
                    > Steve Holden napisa³(a):
                    >
                    >[color=green][color=darkred]
                    >>>>>>Does anyone know a good python mudule that works with MS SQL server?
                    >>>>>
                    >>>>>Google will yield something, but I prefer adodbapi over specialized
                    >>>>>modules. Works good with SQLServer using SSPI auth (others rather not).
                    >>>>
                    >>>>Though it does have problems with stored procedures.
                    >>>
                    >>>Didn't discover any of these.
                    >>>[/color]
                    >>
                    >>Maybe things have changes since I last used adodbapi - can you actually
                    >>run stored procedures now?[/color]
                    >
                    >
                    > Things didn't change, as last update to adodbapi was long time ago... I
                    > had no problems with stored procedures accessed using cursor's execute()
                    > method (i.e. execute('exec sp_someproc, param')), but I never tried to
                    > get any results, just call sp and commit or rollback.
                    >[/color]
                    Thanks. The situation does remain unchanged, then.

                    regards
                    Steve
                    --
                    Steve Holden +44 150 684 7255 +1 800 494 3119
                    Holden Web LLC www.holdenweb.com
                    PyCon TX 2006 www.python.org/pycon/

                    Comment

                    • Peter Decker

                      #11
                      Re: looking for a good python module for MS SQL server

                      On 11/1/05, Jarek Zgoda <jzgoda@o2.usun .pl> wrote:
                      [color=blue]
                      > Things didn't change, as last update to adodbapi was long time ago... I
                      > had no problems with stored procedures accessed using cursor's execute()
                      > method (i.e. execute('exec sp_someproc, param')), but I never tried to
                      > get any results, just call sp and commit or rollback.[/color]

                      Can the adodbapi module be used on a Linux/Mac client? If not, what's
                      the best choice for cross-platform connectivity to a Microsoft SQL
                      Server?

                      --

                      # p.d.

                      Comment

                      • Frank Millman

                        #12
                        Re: looking for a good python module for MS SQL server


                        Peter Decker wrote:[color=blue]
                        > On 11/1/05, Jarek Zgoda <jzgoda@o2.usun .pl> wrote:
                        >[color=green]
                        > > Things didn't change, as last update to adodbapi was long time ago... I
                        > > had no problems with stored procedures accessed using cursor's execute()
                        > > method (i.e. execute('exec sp_someproc, param')), but I never tried to
                        > > get any results, just call sp and commit or rollback.[/color]
                        >
                        > Can the adodbapi module be used on a Linux/Mac client? If not, what's
                        > the best choice for cross-platform connectivity to a Microsoft SQL
                        > Server?
                        >
                        > --
                        >
                        > # p.d.[/color]

                        I preserved this link from a discussion about a year ago, as I may well
                        need it one day. I have not actually tried any of the suggestions.



                        Frank

                        Comment

                        • Jarek Zgoda

                          #13
                          Re: looking for a good python module for MS SQL server

                          Peter Decker napisa³(a):
                          [color=blue][color=green]
                          >>Things didn't change, as last update to adodbapi was long time ago... I
                          >>had no problems with stored procedures accessed using cursor's execute()
                          >>method (i.e. execute('exec sp_someproc, param')), but I never tried to
                          >>get any results, just call sp and commit or rollback.[/color]
                          >
                          > Can the adodbapi module be used on a Linux/Mac client? If not, what's
                          > the best choice for cross-platform connectivity to a Microsoft SQL
                          > Server?[/color]

                          Nope, adodbapi relies on COM/ActiveX subsystem, so it's not available
                          outside Windows.

                          PyMSSQL can use DB-LIB or FreeTDS, so it may have use also on
                          non-windows systems, see http://pymssql.sourceforge.net/ (didn't try
                          this one, though).

                          --
                          Jarek Zgoda

                          Comment

                          Working...