SQL_Hunt
SSC-Dedicated
Points: 33518
More actions
April 29, 2016 at 5:00 pm
#400095
How to typecast the NULL value to 0 in Powershell?
Getting the below error as one variable got the null value while the table is empty.
Method invocation failed because [System.DBNull] does not contain a method named 'op_Addition'.
Thanks.
Steve Jones - SSC Editor
SSC Guru
Points: 734498
April 30, 2016 at 12:15 pm
#1875767
powershell?[int] $a = [System.Management.Automation.Language.NullString]::Value
$a -eq $null
from https://www.codykonior.com/2013/10/17/checking-for-null-in-powershell/
May 2, 2016 at 12:27 pm
#1875983
Thanks Steve!!!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply