Hi,
I keep getting an error when trying to bulk insert a flat file from
query analyzer using a format file.
Here is a sample of the flat file:
"N435",2004-08-31,"BHX","Palma","PMI","Mediterranean","xxxxxxxxxxxxxxxx",14,"KK","Inside
Twin, Shower","","","",993,"009"
"N435",2004-08-31,"BHX","Palma","PMI","Mediterranean","xxxxxxxxxxxxxxxxxx",14,"LL","Inside
Twin, Shower","","","",993,"004"
"N435",2004-08-31,"BHX","Palma","PMI","Mediterranean","xxxxxxxxxxxxxxxxxx",14,"MM","Inside
Twin, Shower","","","",993,"001"
Here is my format file:
8.0
16
1 SQLINT 0 4 "" 1 ID ""
2 SQLCHAR 0 255 "\"," 2
Cruise ""
3 SQLCHAR 0 255 ",\"" 3
Departure_Date ""
4 SQLCHAR 0 255 "\",\"" 4
Airport ""
5 SQLCHAR 0 255 "\",\"" 5
Resort ""
6 SQLCHAR 0 255 "\",\"" 6
Resort_Code ""
7 SQLCHAR 0 255 "\",\"" 7
Region ""
8 SQLCHAR 0 255 "\"," 8
Voyage_name ""
9 SQLCHAR 0 255 ",\"" 9 Duration ""
10 SQLCHAR 0 255 "\",\"" 10 Cabin_Grade
""
11 SQLCHAR 0 255 "\",\"" 11 Cabin_Type ""
12 SQLCHAR 0 255 "\",\"" 12 Hotel_Name ""
13 SQLCHAR 0 255 "\",\"" 13 Tour_definition
""
14 SQLCHAR 0 255 "\"," 14 Hotel_Grade ""
15 SQLCHAR 0 255 ",\"" 15 Price ""
16 SQLCHAR 0 255 "\"\n" 16 Available_Quantity
""
The first column id is not present in the flat file but even if i dont
include this column i still get errors. Any help appreciated.
AllyAlison,
I believe that it is saying that it does not like the collation of "".
Try replacing the "" collation with nothing at all if you want to try that
approach. Or include a collation such as SQL_Latin1_General_Cp1_CI_AS.
Note that the collation is not placed inside of quotes.
Russell Fields
> Here is my format file:
> 8.0
> 16
> 1 SQLINT 0 4 "" 1 ID
> 2 SQLCHAR 0 255 "\"," 2
> Cruise SQL_Latin1_General_Cp1_CI_ASsql
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment