Bulk Insert Task Stored Procedure To Load Text File wit " and |, SSIS
Hi Experts I had a Text File coming into a Shared folder every day and I have to load this data into SQlServer Table and the File (.Dat File) comes in the this Fashion( | as Column Delimiter and " as TextQualifier). I wrote a coStored procedure to Load this Data into the Table But I am getting an error. Actually one of our experts has designed an SSIS package to me but I was a bit confused in using that Package, so I developed this Code. I am here attaching the Code Which I wrote and the Table script to Which I am loading the data into and the Data Sample that I am trying to load. When I am Executing this Procedure I am getting this Error... Please give me a solution as this is very urgent.. Thanks in Advance
Msg 241, Level 16, State 1, Line 45Conversion failed when converting datetime from character string.When I click on the Error it is pointing to this line in the CodeBut I dont Understand What this was..WITH (FIELDTERMINATOR =''|'', ROWTERMINATOR = ''\n'') '
[StartDate] [nvarchar](500) NULL,
[ExpStartDate] [nvarchar](500) NULL,
[ReEntryDate] [nvarchar](500) NULL
And in your actual table they are declared this way
[StartDate] [datetime] NULL,
[ExpStartDate] [datetime] NULL,
[ReEntryDate] [datetime] NULL,
So it is trying to put nvarchar's into a datetime field without a conversion, and it can't.