How to insert or Update NULL value using sqlsrv_query

Pamela Whittaker 1 Reputation point

If you use soemthing like $stmt = sqlsrv_query( $connecttest, $SQL, $params);

How do you update or insert NULL into an image field or varchar field when using parameters?


SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,869 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Sreeju Nair 11,621 Reputation points

    I believe, you are using PHP.

    can you try passing null to the positional parameters in the php function.

    $params = array (null , 1 ,......);

  2. AmeliaGu-MSFT 13,961 Reputation points Microsoft Vendor

    Hi PamelaWhittaker-2747,

    Please try to specify NULL to parameter as others mentioned.
    And here is a similar thread which might be helpful.

    Best Regards,