Hello:
I have created a simple data table:
CREATE TABLE [dbo].[EOD]
(
[ID] [int] NOT NULL,
[DateEOD] [datetime] NOT NULL,
[PriceClose] [decimal](9, 6)NOT NULL,
[PriceHigh] [decimal](9, 6)NOT NULL,
[PriceLow] [decimal](9, 6)NOT NULL,
[PriceOpen] [decimal](9, 6)NOT NULL
CONSTRAINT PK_EOD PRIMARY KEY CLUSTERED
(
[ID], [DateEOD]
) ON [PRIMARY]
) ON [PRIMARY]
GO
I have some data in CSV file to load into the database.
To make things easy, I have the following file: C:\Temp\data.csv
with only one record, like the following:
ID,DateEOD,PriceClose,PriceHigh,PriceLow,PriceOpen
1,20160104,1.010625,1.0107,0.995625,1.003375
I want to use SQL Server Import and Export Wizard to import the above
data.csv file into data table [EOD].
But I always get the error messages:
Error 0xc02020c5: Data Flow Task 1: Data conversion failed while converting column "Date" (10) to column "Date" (65). The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
(SQL Server Import and Export Wizard)
I am using SQL Server 2016 with SP1, my OS is Windows 2012 R2.
Please let me know if I can change anything to make things working.
Thanks,
I have created a simple data table:
CREATE TABLE [dbo].[EOD]
(
[ID] [int] NOT NULL,
[DateEOD] [datetime] NOT NULL,
[PriceClose] [decimal](9, 6)NOT NULL,
[PriceHigh] [decimal](9, 6)NOT NULL,
[PriceLow] [decimal](9, 6)NOT NULL,
[PriceOpen] [decimal](9, 6)NOT NULL
CONSTRAINT PK_EOD PRIMARY KEY CLUSTERED
(
[ID], [DateEOD]
) ON [PRIMARY]
) ON [PRIMARY]
GO
I have some data in CSV file to load into the database.
To make things easy, I have the following file: C:\Temp\data.csv
with only one record, like the following:
ID,DateEOD,PriceClose,PriceHigh,PriceLow,PriceOpen
1,20160104,1.010625,1.0107,0.995625,1.003375
I want to use SQL Server Import and Export Wizard to import the above
data.csv file into data table [EOD].
But I always get the error messages:
Error 0xc02020c5: Data Flow Task 1: Data conversion failed while converting column "Date" (10) to column "Date" (65). The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
(SQL Server Import and Export Wizard)
I am using SQL Server 2016 with SP1, my OS is Windows 2012 R2.
Please let me know if I can change anything to make things working.
Thanks,