sqlcmd -E -d MyDatabase -Q "sp_helpsubscription" -s "," -o file.csv -W -u
Column 23 which is suppose to be a tinyint (subscriber_type) is output as NUL instead of NULL when the value is NULL.
I cannot figure out why it's doing this or a way to fix it. When I run sp_helpsubcription in SSMS the column contains the expected full NULL text.
In order to replication this you need a replicated database with a publication in at least one subscription to it. This particular issue is with a transactional publication.
It does this even if I output the results to the screen instead of to a file.
Edit: The reason I'm doing this is because I can't issue an INSERT #TEMP EXEC sp_helpsubcription because of a NESTED EXEC INSERT inside sp_helppublication.
tinyint
, which can hold values from 0 up to 255. i.e. numbers with up to 3 digits only.