Tuesday, March 27, 2012

Converting Data

Good Day,
I am new SQL Server 2000 and have a dbase III application to convert. I am trying to import data from dbase III to a SQL table but I don't want <NULL> to show in the field. I am having trouble with the ALTER TABLE command.

Can some tell me how to import dbase III data with NULL or how I can alter the columns data to remove NULL?

Any suggestions would be greatly appreciated.

Regards,
RNettlesYou can import dbase III data many ways. It depends on the level of control that you need and coding for example. Here are some options to consider:

1. Use a Data Transformation Services package (Import/Export Wizard)
2. Define a linked server for the dbase III data and use heterogeneous queries from TSQL directly
3. Export data from dbase to text files and use bcp or BULK INSERT

As for changing the values from NULL, you can update them in SQL by choosing some appropriate default value. But the real question is if you want to model unknown value in your schema. This depends on the functionality that you require. You can use UPDATE to change NULL values:

update tbl
set col1 = 0
where col1 is null;

No comments:

Post a Comment