SQLServerPSModule icon indicating copy to clipboard operation
SQLServerPSModule copied to clipboard

Invoke-Sqlcmd does not handle NULL rowversion/timestamp

Open Matteo-T opened this issue 3 years ago • 0 comments

Run this:

    invoke-sqlcmd -ServerInstance SOMESERVER -query 'select cast(null as rowversion) rv'

Result: v21 - System.Data.SqlClient

rv
--
{}

v22 - Microsoft.Data.SqlClient

rv
--

Both cases are wrong: we should show NULL, really. There are probably other issues related to "displaying" NULL, but this one around a NULL rowversion/timestamp type originates from the breaking changes in Microsoft.Data.SqlClient, where such value is returned as DBNull instead of an empty byte[]

Matteo-T avatar Jul 28 '22 06:07 Matteo-T