I'm new to SQL Server and I want to bulk insert any data. This is the table in the database:
CREATE TABLE [dbo].[MARKAZ2]
(
[id] [bigint] IDENTITY(1,1) NOT NULL,
[city] [nvarchar](max) NULL,
[center] [nvarchar](max) NULL,
[copcity] [nchar](10) NULL,
[start_tel] [nchar](20) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
and this is bulk format file:
12.0
4
1 SQLNCHAR 0 10 ";" 1 code SQL_Latin1_General_CP1_CI_AS
2 SQLNCHAR 0 40 ";" 2 city SQL_Latin1_General_CP1_CI_AS
3 SQLNCHAR 0 40 ";" 3 center SQL_Latin1_General_CP1_CI_AS
4 SQLNCHAR 0 40 ";" 4 copcity SQL_Latin1_General_CP1_CI_AS
but when I run this query:
BULK INSERT [ClubEatc].[dbo].[MARKAZ2]
FROM 'd:\newmarkaz.csv'
WITH (FORMATFILE = 'd:\behi.Fmt')
I get this error:
Msg 4863, Level 16, State 1, Line 4
Bulk load data conversion error (truncation) for row 1, column 1 (id).
Msg 7399, Level 16, State 1, Line 4
The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7330, Level 16, State 2, Line 4
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".
What happened? How can I solve this? Thanks.