Home All Groups Group Topic Archive Search About

How to work with extra columns when using bcp?

Author
24 Nov 2005 9:49 AM
Jorge Yanez
Hello, I'm using bcp insertion with ODBC from memory variables, but my code
is for customer databases that can add his own columns to every table. When
people add extra columns to the tables where I do the insertions by bcp, the
bcp_sendrow call fails. I've tried the control option BCPKEEPNULLS but it
doesn't work because I think that it can be used only for insertions from a
file.

There is a way to tell to the bcp process that no specified columns must be
set to NULL?

Thanks in advance.

Jorge.

Author
24 Nov 2005 1:54 PM
Madhivanan
Author
24 Nov 2005 2:34 PM
David Portas
Create a view over the table and BCP into that. All the excluded
columns must be nullable or have defaults.

--
David Portas
SQL Server MVP
--
Author
2 Dec 2005 7:29 AM
Jorge Yanez
It works fine.

Thanks a lot.

Show quote
"David Portas" <REMOVE_BEFORE_REPLYING_dpor***@acm.org> escribió en el
mensaje news:1132842844.912222.178800@g44g2000cwa.googlegroups.com...
> Create a view over the table and BCP into that. All the excluded
> columns must be nullable or have defaults.
>
> --
> David Portas
> SQL Server MVP
> --
>

AddThis Social Bookmark Button