Hi all

Just thought I'd let you know about a gotcha when using ODBC (and ADO I
think)
to connect to Microsoft Sqlserver. I now highly recommend having:

SET NOCOUNT ON

as the first statement in all your stored procedures.

I had a cursor inside a stored procedure that ran correctly from isqlw but
would not run correctly when called from ODBC. I thought the problem may be
something to do with DBI but thankfully it is not. Unfortunately DBI does
not pick up the error message (if any ) that is generated.

The Cursor would fail after a fixed number of rows , any changes to the proc
would seem to randomly alter number of rows before it would fail.

Using the above setting stops SQL returning all the result sets that it
generates for any INSERT, UPDATE,DELETE or SELECT. It is the number of rows
effected by the action. eg

(1 row effected)


Adding the above SET statement fixed the problem.

regards

Tim


------------------------------------------------------------------------
For more information about Barclays Capital, please
visit our web site at http://www.barcap.com.


Internet communications are not secure and therefore the Barclays 
Group does not accept legal responsibility for the contents of this 
message.  Although the Barclays Group operates anti-virus programmes, 
it does not accept responsibility for any damage whatsoever that is 
caused by viruses being passed.  Any views or opinions presented are 
solely those of the author and do not necessarily represent those of the 
Barclays Group.  Replies to this email may be monitored by the Barclays 
Group for operational or business reasons.

------------------------------------------------------------------------

Reply via email to