Search code examples
sybasebcp

Sybase BCP out with null values


Is there a way to get BCP out to return NULL values rather then just blanks

Current Output:

'apse0420', '', '2', '2'

What I want:

'apse0420', 'NULL', '2', '2'

BCP out code:

bcp <db>..<table> out test.txt -S <server> -U <username> -P <password> -c -t ", " -r "\n"

Solution

  • create a view from table and convert NULL columns into string 'NULL'. BCP out the view