I am doing a bulk copy of program variables to a SQL Server 2005 table and I use bcp_bind
and bcp_sendrow
in a C++ application
However, some of the integer columns in the table allow null
values. I'm not quite sure how I should be sending null
values at runtime using bcp_sendrow
when the need arises to send a null
value for one of the columns.
Documentation on bcp_bind
says:
To bulk copy a row to the server containing a NULL value for the bound column, the value of the instance's iIndicator member should be set to SQL_NULL_DATA
However this still doesn't make things quite clear. Am I supposed to have 2 different calls to bcp_sendrow
: one for the not null case and another for the null case?