SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Importing data using DTS
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

AskSQLTeam
Ask SQLTeam Question

USA
0 Posts

Posted - 03/20/2007 :  09:50:24  Show Profile  Visit AskSQLTeam's Homepage  Reply with Quote
Howard writes "I have raw data in a flat file that has blanks that I'd like to be considered NULLs in the SQL server database.

I am hoping that there is a very simple way to do this.
I do not want to check each field for a blank first.

A similar problem is that sometimes a numeric field might have bad data, say a character somewhere. Is there a simple way to convert the bad data into a NULL automatically?"

nosepicker
Constraint Violating Yak Guru

USA
366 Posts

Posted - 03/20/2007 :  21:10:54  Show Profile  Reply with Quote
It would probably be easier and faster if you import the raw data into a staging table first. Then you can use SQL statements to do your conversions. Trying to do conversions during the import can be messy.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000