Powershell and SQL parameters. If empty string, pass DBNull

后端 未结 4 496

I got this parameter:

$objDbCmd.Parameters.Add(\"@telephone\", [System.Data.SqlDbType]::VarChar, 18) | Out-Null;
$objDbCmd.Parameters[\"@telephone\"].Value =         


        
4条回答
  •  天涯浪人
    2021-01-18 08:08

    Always append +"" at the end of db values...

    $command.Parameters["@EmployeeType"].Value= $ADResult.EmployeeType + ""

提交回复
热议问题