ODBC Functions & MS SQL Server 2005

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Anyone else using the odbc_* functions to interact with MS SQL Server 2005?

I'm having a problem getting odbc_num_rows() to return anything other than
-1 when querying a stored procedure.  I can get it to work using Top in a
normal query (non-stored procedure).

SELECT Top 1000000 * FROM Table

if I do an odbc_num_rows( result ) on that, I get the number of rows.
However...

EXEC ProcedureName @Var = 'value'

if I do an odbc_num_rows( result), I get -1.  The same is true if I did a
straight SELECT * FROM Table.  I've tried putting Top in my query in the
stored procedure.

Right now I'm either doing an extra query for @@ROWCOUNT, or I'm doing two
result sets, a counting query, and then the normal query.  I am concerned
about performance in doing the two queries, and with @@ROWCOUNT, I feel I'm
just adding extra things to the code that may be unreliable?

>From what I've read, its something with the ODBC driver, and updating the
ODBC driver isn't an option.

Anyone else having this problem?  Any suggestions?

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.

"Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life."

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux