tpavan7329
Starting Member
18 Posts |
Posted - 2011-08-04 : 00:05:41
|
I have a task import csv file into a table using bulk insert. CSV has records something like this"User_ID","User_Nickname","User_Registration_Date","User_Country","Game_Id","Game_Name","Session_start_time","Session_End_time","User_Device_ID","User_Device_Type","User_Device_OS","sessionstat_id"4349,"norx1","2010-12-07 20:05:29","UA",2000,"Poker","2011-07-30 08:08:02","2011-07-30 08:16:43","d4eb4d008bc0241d46baass57bf6d475a9d","iPhone/iPod/iPad","iPhone OS",10064125584364,"Asdfg","2010-12-08 10:23:48","KW",2000,"Poker","2011-07-30 06:16:41","2011-07-30 06:29:38","76401fe7ae00d6301628e33fdghcaa916d43","iPhone/iPod/iPad","iPhone OS",1056811020SQL Script:BULK INSERT core_reporting.dbo.PPS_SessionReport_CCBulkTest FROM 'C:\report_2011_07_12_2000.csv' WITH ( FIRSTROW=2, FORMATFILE='D:\Test\formatfile.fmt' )Format File:1 SQLCHAR 0 50 "\," 0 UserId SQL_Latin1_General_Cp437_BIN2 SQLCHAR 0 255 "\",\"" 1 UserNickName SQL_Latin1_General_Cp437_BIN3 SQLCHAR 0 100 "\",\"" 2 UserRegistrationDate SQL_Latin1_General_Cp437_BIN4 SQLCHAR 0 50 "\",\"" 3 UserCountry SQL_Latin1_General_Cp437_BIN5 SQLCHAR 0 50 "\," 4 GameId SQL_Latin1_General_Cp437_BIN6 SQLCHAR 0 255 "\",\"" 5 GameName SQL_Latin1_General_Cp437_BIN7 SQLCHAR 0 100 "\",\"" 6 SessionStartTime SQL_Latin1_General_Cp437_BIN8 SQLCHAR 0 100 "\",\"" 7 SessionEndTime SQL_Latin1_General_Cp437_BIN9 SQLCHAR 0 255 "\",\"" 8 UserDeviceID SQL_Latin1_General_Cp437_BIN10 SQLCHAR 0 50 "\",\"" 9 UserDeviceType SQL_Latin1_General_Cp437_BIN11 SQLCHAR 0 50 "\",\"" 10 UserDeviceOS SQL_Latin1_General_Cp437_BIN12 SQLCHAR 0 50 "\r\n" 11 SessionStatID SQL_Latin1_General_Cp437_BINI get below error messageMsg 9422, Level 16, State 48, Line 1XML parsing: line 2, character 0, incorrect document syntaxCan anyone help me to figure out what the issue here is?T Pavan Kumar |
|