Execute SQl Task Error SSIS Package

Hi all,

I`m using for each loop container in my package to grab the file name from the source path. I have created 2 vairables

FilePath and SourceFolder

I`m using execute sql task inside the container and this is my query

Insert into  [dbo].[DCA_FF_TEST] (File_Name,File_Date) SELECT File_name = ?,
File_Date = GetDate()

Please not the Table I am trying to insert has more columns but at this stage I dont need them.

When i execute the task I get an error

[Execute SQL Task] Error: Executing the query "
INSERT INTO   [dbo].[DCA_FF_TEST] ([File_Name],[F..." failed with the following error: "The statement has been terminated.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

Can someone point me in the right direction? Am I missing anything?

Resultset property Set to None

Parameter Mapping: Variablename: FilePath , Direction: Input, datatype : Varchar, Parametername: 0, ParameterSize: 100.

I`ve checked the connection as well it works.


February 6th, 2015 12:54pm

Did you try

Insert into  [dbo].[DCA_FF_TEST] (File_Name,File_Date)
SELECT ?, GetDate()

Or

Insert into  [dbo].[DCA_FF_TEST] (File_Name,File_Date) VALUES (?, GetD

Free Windows Admin Tool Kit Click here and download it now
February 6th, 2015 1:06pm

Yes both ways I get the same error
February 6th, 2015 2:58pm

In Execute SQL Task, did you map your parameter FilePath (I think it is a fall path of file)?
Free Windows Admin Tool Kit Click here and download it now
February 6th, 2015 3:04pm

You said that the table in which you are trying to insert has more columns other than the 2 (File_Name, File_Date), I guess there are other columns that doesn't accept NULLs and so the INSERT statement fails ?
February 6th, 2015 3:12pm

Insert into  [dbo].[DCA_FF_TEST] (File_Name,File_Date) 
SELECT File_Name=?, GetDate()

The above code actually worked.
Free Windows Admin Tool Kit Click here and download it now
February 6th, 2015 3:36pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics