How to insert or Update NULL value using sqlsrv_query

Pamela Whittaker 1 Reputation point
2022-03-02T09:39:25.277+00:00

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?

Thanks

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

2 answers

Sort by: Most helpful
  1. Sreeju Nair 12,611 Reputation points
    2022-03-02T11:03:19.727+00:00

    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,991 Reputation points Microsoft Vendor
    2022-03-03T07:31:47.54+00:00

    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,
    Amelia


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.