Subject Re: [firebird-support] Importing data from SQL Server (null values issue)
Author Avi Schwartz
Avi Schwartz wrote:

> Hi,
> I need to import data from SQL Server 7.0 into a new FB 1.5.1 database.
> At this time the tables on both databases will be pretty much the
> same for now. In reading Helen's book, I understood that the only way
> to import the data into FB is by using fixed-size external files which
> will be used as tables and then selected into the real FB tables. I can
> use bcp and format files to get the fixed length data files (although it
> is a real pain to create the format files for all tables), but how do I
> handle null values? What value in the external files will be recognized
> by FB to be a null value vs. a blank string?

OK, I tried the following and it was not good: I created an external
table and inserted 2 rows, one which had a column with a null value. I
also created a regular table with the same structure and inserted the
same 2 rows. I was using isql in this experiment.

Selecting the data out from the two tables shows that the internal table
preserved the null value, but it was converted to spaces in the external

This means that the external table method cannot be used to import
nullable values without much data manipulation on both sides.