| Author |
Topic |
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-07-16 : 13:54:43
|
What a pain in the A_SDid I mention I hate format files...What's wrong with the following..It's telling me:Invalid collation name for source column 1For the format file:8.011 SQLCHAR 0 7500 "\r\n" 1 dataRow SQL_Latin1_General_CP1_CI_AS Also If the file is only 80 bytes wide, can I still specify a length of 7500?Brett8-) |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-07-16 : 14:04:03
|
| Well it looks like a valid collation (esp since I grabbed from the script of the table...)So that's not it.The table has three columns, but the data file has 1.Do I need to specify the three columns with a server order of 0?But that doesn't make any sense because they're not in the data fileaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhhhhhhBrett8-) |
 |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2003-07-16 : 14:05:51
|
| You BCP junkies ... always trying to make life harder for yourselves ...Why specify collation at all?Jonathan{0} |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-07-16 : 14:09:40
|
| AND...I'm trying to generate it in interactive mode but keep getting errors...why is this so painful...Brett8-) |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-07-16 : 14:10:39
|
quote: You BCP junkies ... always trying to make life harder for yourselves ...Why specify collation at all?Jonathan{0}
It's just for 1 column. I took it out and it still yelled at me.I think you need to specify it now in 2kBrett8-) |
 |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2003-07-16 : 14:17:03
|
| The table has three columns? Then you will have to specify all three in the format file.I just checked BOL and it does look like collation is mandatory, my bad. I hardly ever use BCP.Jonathan{0} |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-07-16 : 14:29:53
|
Yup, that's it...But When I do8.031 SQLCHAR 0 80 "\r\n" 1 DataRow SQL_Latin1_General_CP1_CI_AS2 SQLCHAR 0 80 "" 0 BatchId SQL_Latin1_General_CP1_CI_AS3 SQLCHAR 0 80 "" 0 RowId SQL_Latin1_General_CP1_CI_AS I get 0 rows affected on the BULK INSERTAnd if I do8.031 SQLCHAR 0 80 "" 1 DataRow SQL_Latin1_General_CP1_CI_AS2 SQLCHAR 0 80 "" 0 BatchId SQL_Latin1_General_CP1_CI_AS3 SQLCHAR 0 80 "\r\n" 0 RowId SQL_Latin1_General_CP1_CI_AS I get 1 row affected...like it took the 5 rows and slammed all the rows as 1.Brett8-) |
 |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2003-07-16 : 14:38:00
|
| Looks like you have the "\r\n" in the wrong place, try putting it in row 1 vice row 3.Jonathan{0} |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-07-16 : 14:43:32
|
quote: Looks like you have the "\r\n" in the wrong place, try putting it in row 1 vice row 3.Jonathan{0}
Jonathan,Look a little closer...Let's get crazy and try all 3Brett8-) |
 |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2003-07-16 : 14:49:36
|
I'm down with crazy ... Jonathan{0} |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-07-16 : 14:54:38
|
Here's the data file:H 07/04/2003Header Record For Test FileD07/04/2003 APPLES 1.00D07/04/2003 PEACHES 10000000.00D07/04/2003 PEACHES 10000000.00T 07/04/2003Trailer Record For Test File 00000000003 And with \r\n 3 times, it actually just loaded the header row only (I think)Brett8-) |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-07-16 : 14:58:37
|
What a TOTALTOTALTOTALTOTALTOTALSCRUB AM I8.031 SQLCHAR 0 7500 "\r\n" 1 DataRow SQL_Latin1_General_CP1_CI_AS2 SQLCHAR 0 0 "" 0 BatchId SQL_Latin1_General_CP1_CI_AS3 SQLCHAR 0 0 "" 0 RowId SQL_Latin1_General_CP1_CI_AS Jonathan, thanks for all your help.Brett8-) |
 |
|
|
|