I have got an *.dat file which has been created from the Oracle Db. I need to Import it into SQL server 2008.
In the *.Dat file, Columns are pipe (|) delimited and semicolon (;) as end of row.
I am getting the error using this piece of code:
BULK INSERT Database_name.schema_name.Tablename FROM 'F:\******\***\******.dat' WITH ( FIELDTERMINATOR = '|', ROWTERMINATOR = ';' );
Bulk load: An unexpected end of file was encountered in the data file.... Please Help ASAP.....
I have not used this code, but i am not sure is this correct or not?
EXEC xp_cmdshell 'bcp Database_name.schema_name.Tablename in 'F:\******\***\******.dat' -c -t ^| -r ^; -T'
Please suggest ASAP....