From the below table how to update the item column to null for all rows using merge update statement
| ID | Product | Items |
| 1 | Product1 | 2 |
| 2 | Product2 | 2 |
| 3 | Product3 | 2 |
| 4 | Product4 | 1 |
| 5 | Product5 | 1 |
Thanks
From the below table how to update the item column to null for all rows using merge update statement
| ID | Product | Items |
| 1 | Product1 | 2 |
| 2 | Product2 | 2 |
| 3 | Product3 | 2 |
| 4 | Product4 | 1 |
| 5 | Product5 | 1 |
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Tahir AnsariPosted Sep 13, 2023, 6:18 PM
Saravanan GanesanPosted Sep 24, 2023, 5:13 PM
You can update the "Items" column to NULL for all rows in the table using a simple SQL UPDATE statement. There's no need to use a MERGE statement for this task. Here's the SQL statement to achieve this:
UPDATE YourTableName
SET Items = NULL;
Replace
YourTableNamewith the actual name of your table. This query will set the "Items" column to NULL for all rows in the table, effectively clearing the "Items" column for all records.Cr BhargaviPosted Sep 20, 2023, 11:01 AM
Mohammad HussainPosted Sep 14, 2023, 6:57 AM