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)
 Load data from flat file to sql server

Author  Topic 

Sifu
Starting Member

8 Posts

Posted - 2006-12-12 : 00:34:51
Hi everyone,
I have encountered a problem trying to load data from a flat file to sql server. I'm using the Sql Server Integration Services (SSIS) wizard to import data. It's seem to run ok (no error messages) but when view the table I have just load it's all null. I can't explain why this is happening. Can anyone help or tell me what I've done wrong?

The structure of the flat file is:

state,cvmake,cvmodel,pvyear,...
ntp,ford,falcon,2005,....
ntp,holden,commodore,2001,....
ntp,chevrolet,silverado,2003,....
.,.,.,.,...
.,.,.,.,...
ntp,suzuki,vitara,2000,....

Cheers,

Sifu

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-12-12 : 01:07:26
Are you using proper datatypes? If you are importing data and using integer as datatype when importing names, nulls are inserted instead, just as you describe.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-12-12 : 05:53:36
also look into using FastParse if you can:
http://weblogs.sqlteam.com/mladenp/archive/2006/05/26/9992.aspx

here are some comparisons on bulk importing:
1st run:
http://weblogs.sqlteam.com/mladenp/articles/10631.aspx
2nd run (improved):
http://weblogs.sqlteam.com/mladenp/archive/2006/07/22/10742.aspx

and try using bulk insert if you can.



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

Sifu
Starting Member

8 Posts

Posted - 2006-12-12 : 17:11:05
Hi Peter,
Thanks for the reply.

There are more than 5000 records in the flat file. The table after import only show 1 row of null value for all fieldnames. The results after the import in the table is:

state cvmake cvmodel pvyear ..... date
null null null null ..... null

If I have incorrect datatype wouldn't it only showing null for that particular column (fieldname)? I probably didn't explain my well in the previous.

Looking forward to your reply.

Cheers

Sifu
Australia


quote:
Originally posted by Sifu

Hi everyone,
I have encountered a problem trying to load data from a flat file to sql server. I'm using the Sql Server Integration Services (SSIS) wizard to import data. It's seem to run ok (no error messages) but when view the table I have just load it's all null. I can't explain why this is happening. Can anyone help or tell me what I've done wrong?

The structure of the flat file is:

state,cvmake,cvmodel,pvyear,...
ntp,ford,falcon,2005,....
ntp,holden,commodore,2001,....
ntp,chevrolet,silverado,2003,....
.,.,.,.,...
.,.,.,.,...
ntp,suzuki,vitara,2000,....

Cheers,

Sifu



Go to Top of Page

Sifu
Starting Member

8 Posts

Posted - 2006-12-12 : 17:48:39
Thanks Spirit1.

Much appreciated.

Sifu


quote:
Originally posted by spirit1

also look into using FastParse if you can:
http://weblogs.sqlteam.com/mladenp/archive/2006/05/26/9992.aspx

here are some comparisons on bulk importing:
1st run:
http://weblogs.sqlteam.com/mladenp/articles/10631.aspx
2nd run (improved):
http://weblogs.sqlteam.com/mladenp/archive/2006/07/22/10742.aspx

and try using bulk insert if you can.



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp

Go to Top of Page
   

- Advertisement -