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)
 .FMT file causing bad data on import

Author  Topic 

dzirkelb
Yak Posting Veteran

53 Posts

Posted - 2009-10-07 : 17:24:17
I am importing a .fmt for a bulk insert, but, it is causing the data to be incorrect. here is the .fmt file:

8.0
12
1 SQLCHAR 0 255 "\t" 1 Allied ""
2 SQLCHAR 0 255 "\t" 2 Mfr ""
3 SQLCHAR 0 255 "\t" 3 Mfr ""
4 SQLCHAR 0 255 "\t" 4 Product ""
5 SQLINT 0 4 "\t" 5 Price ""
6 SQLCHAR 0 255 "\t" 6 UOM ""
7 SQLINT 0 4 "\t" 7 Lead ""
8 SQLINT 0 4 "\t" 8 Sells ""
9 SQLINT 0 4 "\t" 9 Available ""
10 SQLINT 0 4 "\t" 10 Min ""
11 SQLINT 0 4 "\t" 11 Catalog ""
12 SQLCHAR 0 255 "\r\n" 12 URL ""

this is coming from a tab deliminated text file. I read somewhere that everything should be SQLCHAR for text files; however, when I change them, then I get an invalid

When I run it as SQLINT, I get no erros; however, I get bad data. Example:

What should be data of 1, results on the import of 153104672.

Any ideas?

dzirkelb
Yak Posting Veteran

53 Posts

Posted - 2009-10-08 : 09:24:38
Here is the data formats:

1: varchar 255
2: varchar 255
3: varchar 255
4: varchar 255
5: float 8
6: varchar 255
7: int 4
8: int 4
9: int 4
10: int 4
11: varchar 255
12: int 4

And, I am not importing all fields.
Go to Top of Page
   

- Advertisement -