Re: Attempt to initiate a new SQL Server operation with results pending.



Martin J. Evans wrote:

>As far as I am aware this is a limitation of the TDS protocol used and
>your example code will not work unless you force a server-side cursor (see
>DBD::ODBC pod and look for odbc_SQL_ROWSET_SIZE but I warn you that you really
>will need to close everything i.e. force SQLFreeStmt(SQL_CLOSE) or you will get
>hangs).
>
>
I see. Sounds good.

>BTW, the example in the pod should be $dbh->{odbc_SQL_ROWSET_SIZE} = 2 not
>$dbh->{SQL_ROWSET_SIZE} = 2.
>
>
>
Just tried that. Doesn't seem to have any effect on my system. Here's
the line I added right after create $dbh :
$dbh->{odbc_SQL_ROWSET_SIZE} = 2;

>I would seriously suggest you try and avoid multiple active statements - there
>is nearly always a SQL or some other way.
>
>
Perhaps. To be honest I'm not that concerned. If it was DBD::mysql I'd
be mortified, but I don't have too much to do with SQL server, so I'll
just create lots of $dbh things and ->finish all the statements and hope
that things hold together while I'm sitting around twiddling my thumbs
waiting for MySQL-5.0.x to stabalise ( stored procedures & views ).

Thanks for your help.

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak@xxxxxxxxxxxxxxxxxxxx
website: http://www.nusconsulting.com.au
.



Relevant Pages

  • Re: Cannot insert or update columns from multiple tables (post #2) Need help please
    ... Provider for SQL Server) to update records from a dataset on a multi-tables ... I am using a server-side cursor ... But if I change the SQL driver to use an ODBD DataSource (Microsoft OLE DB ... Provider for ODBC Driver), is it working. ...
    (borland.public.delphi.database.ado)
  • DBD::ODBC multiple active statements (was Trouble Installing DBD::ODBC with postgresql)
    ... packages that were supposed to contain these headers. ... By default SQL Server did not used to support multiple active statements if any of them were select statements. ... In MS SQL Server 2005, there is a new thing called MARS which allows multiple active select statements but it has some nasty implications it you are also doing transactions. ... If anyone wants to report success with a particular driver and multiple active statements I will collect them and add a FAQ. ...
    (perl.dbi.users)
  • Re: TADOQuery slow inserts in Oracle
    ... Use server-side cursor - you do not need row cache if you do only inserts on ... http://www.oledbdirect.com - The fastest way to access MS SQL Server, ... > I've used ADO before with Oracle, but never had such slow effects as I'm ... What can I do with my TADOQuery to speed up the .Post? ...
    (borland.public.delphi.database.ado)
  • Re: What is the fastest way to add a large number of records ?
    ... Try open recordset with server-side cursor and append rows without SQL - on ... If you still need speed improvement, on MS SQL Server the fastest inserts ... Server OLEDB provider and is not accessible from ADO. ...
    (borland.public.delphi.database.ado)
  • Re: Any chance to replace the Seek method by converting from DAO to ADO ?
    ... I am trying to port a VB -Access-DAO application to a SQL Server 2K-ADO ... Is there any chance to replace the DAO Seek method with a SQL-Server 2K ADO ... the Recordset Open statement in addition to using a server-side cursor. ...
    (microsoft.public.vb.database.ado)