Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Importing date 00-Jan-00

Author  Topic 

clir
Starting Member

6 Posts

Posted - 2005-06-02 : 18:36:47
Hi,

i want to import a csv file into my sql server7 table.
This csv file contains date columns with values '00-Jan-00'. SQL Server does not seem to like this format: it provokes an error.
The process of importing the csv file is an automatic task.

Is there a mean to work around? I was maybe thinking of a trigger on insert if column is '00-jan-00' replace value by <NULL>.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-06-02 : 18:42:18
Import the data into a staging table where the column that will contain this invalid date is varchar. Then use T-SQL to move your data to the real table, you can do a convert or replace it with null in that step.

Tara
Go to Top of Page
   

- Advertisement -