Under Microsoft SQL Server, the Microsoft Access function NZ ([field], value-at-zero) can not be used.
Instead, you can use the ISNULL ([field], value-at-zero) function
As a Transact SQL command
UPDATE [dbo].[tbl_Notes] SET [sumViews] = ISNULL([sumViews],0)+1 WHERE IDNote=8 |
Example:
The integer value SumViews was initially created with NULL, dbnull.
An Increase update with a SQL number increase would result in an error or result in NULL.
Test: Under SQL Server Management Studio, Query
Therefore the use of ISNULL (sumViews, 0) can be increased with +1 without problems.
If you let the script through once
Result:
the zero was increased as 0 + 1 directly on the SQL Server
with UPDATE [dbo]. [tbl_Notes]
SET [sumViews] = ISNULL ([sumViews], 0) +1
Transact Script:
USE [readdy] GO
UPDATE [dbo].[tbl_Notes] SET [sumViews] = ISNULL([sumViews],0)+1 WHERE IDNote=8 GO |