June 17, 2010 at 3:51 pm
I'm trying to import data from a dat file to a table using BULK INSERT.
USE abc
GO
Truncate table dbo.Det_Temp
go
BULK INSERT dbo.Det_Temp
FROM 'G:\Dat file\CE2009.DAT'
WITH (FORMATFILE = 'G:\Dat file\Det.fmt');
GO
But I'm getting the following error:
Msg 4822, Level 16, State 1, Line 1
Cannot bulk load. Invalid number of columns in the format file "G:\Dat file\Det.fmt".
I've attached the format file by the name fmt.txt as it doesn't take .fmt format.
Thanks
June 17, 2010 at 8:07 pm
Try adding a carriage return at the end of the last line if there isn't one there already.
Leo
Leo
Nothing in life is ever so complicated that with a little work it can't be made more complicated.
June 18, 2010 at 8:15 am
The format file is actually created by a developer, so I've no clue what you are trying to say..
June 18, 2010 at 10:31 am
Any ideas guys?
June 18, 2010 at 10:41 am
Can you post the table definition and some sample data we could play with?
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply