# Stored procedure error propagation from MSSQL to PDO

- Thread: https://externals.io/message/43852
- Original archive: https://news-web.php.net/php.internals/43852
- Started by Massimiliano Cavicchioli on 2009-05-04T18:27:39+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #43852 — Massimiliano Cavicchioli — 2009-05-04T18:27:39+00:00

URL: https://externals.io/message/43852#43852

Hi all,
I could not work out a way to make an error occurred on a stored procedure on 
on MSSQL server (2005) propagate back into PHP using PDO and PDOStatement.
My setup is the following:
PHP 5.2.9 / PDO_DBLIB running on a CentOS 5.3 machine executing the most 
simple stored procedure on a MSSQL Server 2005 that only does RAISERROR().
Sample PHP code is attached.
Can anyone address me to a best practices tutorial regarding this case?
Thanks in advance,
Massi. 
  
 
Massimiliano Cavicchioli
Senior Support Engineer
Zend Technologies, Ltd.
Email:massi@zend.com
Tel:+972.3.6139544
www.zend.com

---

## #44275 — Wez Furlong — 2009-06-14T15:11:23+00:00

URL: https://externals.io/message/43852#44275 · In reply to: #43852

Use PDO_ODBC and make sure you are running with the most recent
version of FreeTDS and its ODBC driver.

--Wez.


>  Hi all,
> I could not work out a way to make an error occurred on a stored procedure on
> on MSSQL server (2005) propagate back into PHP using PDO and PDOStatement.
> My setup is the following:
> PHP 5.2.9 / PDO_DBLIB running on a CentOS 5.3 machine executing the most
> simple stored procedure on a MSSQL Server 2005 that only does RAISERROR().
> Sample PHP code is attached.
> Can anyone address me to a best practices tutorial regarding this case?
> Thanks in advance,
> Massi.
>
>
> Massimiliano Cavicchioli
> Senior Support Engineer
> Zend Technologies, Ltd.
> Email:massi@zend.com
> Tel:+972.3.6139544
> www.zend.com
