September 21, 2003 at 10:09 pm
Hi,
I am trying to BCP out a table which has new NULL values for some fields. I need to get all the data in a flatfile from a table. If any rows contain NULL values, I want to fill with spaces. So that this flat file can be used with positional file (similar to format file) as an input to another system. This system processcess this file based on the position of the data.
Please help...
.
September 22, 2003 at 3:32 am
One way is to specify a select statement and for the character based columns use IsNull(Col1,Space(10)).
September 23, 2003 at 10:48 am
Thanks Len. But in SQL Server 6.5, we don't have query option. I am trying from a client which has SQL 2000 BCP utility.
.
September 24, 2003 at 1:13 pm
Rather than trying a fixed length type of file why don't you try a delimited file? That way you should be able to just export the nulls and then handle them on the import. Otherwise you coult transform the data into an "Export" table prior to running BCP.
Gary Johnson
Microsoft Natural Language Group
DBA, Sr. DB Engineer
Gary Johnson
Microsoft Natural Language Group
DBA, Sr. DB Engineer
This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply