Hi All -
What I am looking to do is use a Bulk Insert to import a cvs file to a table. This table is for zip code rates (tax's based on zip codes). When do so using this code:
Bulk insert ziptaxrate
(fieldterminator = ',',
rowterminator = '')
I then get the following error:
Msg 4864, Level 16, State 1, Line 1
Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 3 (TaxClassID).
This is the table build (also attached) :
/****** Object: Table [dbo].[ZipTaxRate] Script Date: 06/09/2014 09:39:21 ******/
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[ZipTaxRate](
[ZipTaxID] [int] IDENTITY(1,1) NOT NULL,
[ZipCode] [nvarchar](10) NOT NULL,
[TaxClassID] [int] NOT NULL CONSTRAINT [DF_ZipTaxRate_TaxClassID] DEFAULT ((1)),
[TaxRate] [money] NULL,
[CreatedOn] [datetime] NOT NULL CONSTRAINT [DF_ZipTaxRate_CreatedOn] DEFAULT (getdate()),
CONSTRAINT [PK_ZipTaxRate] PRIMARY KEY CLUSTERED
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
Attached are screen shots also and the csv test file.
Any help would be great.