Note that there are some explanatory texts on larger screens.

plurals
  1. POSQLSRV PRINT function issue
    text
    copied!<p>I have recently switch to SQLSRV from ODBC to connect MS SQL 2008 from PHP. There is a strange issue with PRINT function in stored procedure. IF PRINT function display more than approximately 700 characters, "HTTP Error 500.0 - Internal Server Error" message is return.</p> <p>Following are list of tools I am using: </p> <ol> <li>PHP 5.3.6 </li> <li>MS SQL Server 2008 </li> <li>[PHP_MSSQL]extension=php_sqlsrv_53_nts.dll </li> <li>IE8 (this issue is with other browsers as well like firefox, chrome) </li> <li>web server IIS</li> </ol> <p>Following is the code PHP CODE:</p> <pre><code>&lt;?php $link = sqlsrv_connect( 'dbname\instance2008', array( "UID"=&gt;'UID',"PWD"=&gt;'PWD', "Database"=&gt;'Database_name',"CharacterSet" =&gt; "UTF-8", "MultipleActiveResultSets" =&gt; 0)); if(!$link) die( print_r(sqlsrv_errors(), true)); sqlsrv_configure('WarningsReturnAsErrors', 0); $sql = "EXEC spa_i18n_test"; $result = sqlsrv_query($link, $sql); if(!isset($result)){ error_reporting(2047); } while( $row = sqlsrv_fetch_array( $result)){ echo $row[0] . ": " . $row[1] . "&lt;br /&gt;"; } ?&gt; </code></pre> <p>SCRIPT FOR stored procedure.</p> <pre><code>Create proc spa_i18n_test AS SET NOCOUNT ON print '2222222222222111111111111111112dddddddddddddd2222222222 222111111111111111112dddddddddddddd2222222222222111111 111111111112dddddddddddddd222222222222211111111111111111 2dddddddddddddd222222222222211111111111111122222222222221 11111111111111112dddddddddddddd222222222222211111111111111 1112dddddddddddddd2222222222222111111111111111112dddddddddd dddd2222222222222111111111111111112dddddddddddddd22222222222 221111111111111112222222222222111111111111111112dddddddddddd dd2222222222222111111111111111112dddddddddddddd2222222222222 111111111111111112dddddddddddddd2222222222222111111111111111 112dddddddddddddd2222222222222111111111111111222222222222211 1111111111111112ddddddddd22222wwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwww' select '1' a, '2' b </code></pre> <p>I have tried the solution given in <a href="http://support.microsoft.com/kb/269412" rel="nofollow">http://support.microsoft.com/kb/269412</a> but sadly it didn't work for me.</p> <p>Please share some work around.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload