Just throwing this out there in case someone has come across this before and
hasn't found a solution:

If you are performing a stored procedure inside a loop, it is a good idea
to unset the variable that mssql_init returns so that you do NOT bind
multiple values to the same stored procedure:

foreach($input  as $sid=>$value) {
  $stmt = mssql_init("sp_doSomething");
  mssql_bind($stmt, "@sid", $sid, SQLINT4, false);
  mssql_bind($stmt, "@value", $value, SQLINT4, false);
  $result = mssql_execute($stmt);
  unset($stmt);  // <---VERY important

Even doing the mssql_init outside the loop does not help because of the
multiple binds happening inside the loop.

Failing to do the above generates "Access Violations...memory cannot
be 'written'" errors on the server.  My hypothesis is that the error
is generated when you try to bind to a stored procedure after it has
already been executed.  You have been warned.

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to