Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Bulk insert and format file error : "Cannot bulk l

Author  Topic 

nonabona
Starting Member

2 Posts

Posted - 2014-10-26 : 00:32:25
Hello

I have my table and bulk insert as:

DROP TABLE states
CREATE TABLE states(

zip int NOT NULL,
city varchar(50) NOT NULL,
state varchar(50) NOT NULL,
latitude decimal NOT NULL,
longitude decimal NOT NULL,
timezone int NOT NULL
)
GO

BULK INSERT states
FROM
'C:\zipcode.csv'
WITH(

FORMATFILE = 'C:\FormatFile.fmt'
)
GO


My format file is as:

12.0
6
1SQLINT06","1zip""
2SQLVARCHAR050","2citySQL_Latin1_General_CP1_CI_AS
3SQLVARCHAR050","3stateSQL_Latin1_General_CP1_CI_AS
4SQLDECIMAL010","4latitude""
5SQLDECIMAL010","5longitude""
6SQLINT02","6timezone""

I don't understand why I am still getting the error:

"Cannot bulk load. Unknown version of format file"

I am using SSMS 2014 and microsoft tells me the version is 12.0

what is going on?

Thanks

nonabona
Starting Member

2 Posts

Posted - 2014-10-26 : 00:51:37
When I changed the version from 12.0 to 11.0 the error changes.
Now it says:
"Cannot bulk load. Invalid column number in the format file"
Go to Top of Page
   

- Advertisement -