Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Execute sql task failing

$
0
0

Hi All,

I have a pakage that loads data from Oracle into sql server database. In the control flow task i have an Execute sql task and a data flow task and again another execute sql task. The Execute sql task after the data flow task is failing with the following errors:

Error: The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

[Execute SQL Task] Error: Executing the query "update [DW[CIP_APP].[TBL] set DATE_REVISED" 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.

Error: The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

In the EXECUTE SQL TASK thats failing i have an UPDATE Statement:

UPDATE [DW].[APP].[tbl]  
SET    date_revised = CONVERT(DATETIME, date_revised, 120), 
       date_non_bid = CONVERT(DATETIME, date_non_bid, 120), 
       date_bid_orig = CONVERT(DATETIME, date_bid_orig, 120), 
       date_bid_current = CONVERT(DATETIME, date_bid_current, 120), 
       date_final_acceptance = CONVERT(DATETIME, date_final_acceptance, 120) 
UPDATE [DW].[APP].[tbl] 
SET    date_est_start = CONVERT(DATETIME, date_est_start, 120), 
       date_est_finish = CONVERT(DATETIME, date_est_finish, 120), 
       date_act_start = CONVERT(DATETIME, date_act_start, 120), 
       date_act_finish = CONVERT(DATETIME, date_act_finish, 120), 
       date_orig_start = CONVERT(DATETIME, date_orig_start, 120), 
       date_orig_finish = CONVERT(DATETIME, date_orig_finish, 120), 
       date_per_submittal = CONVERT(DATETIME, date_per_submittal, 120), 
       date_per_approval = CONVERT(DATETIME, date_per_approval, 120), 
       date_idem_approval = CONVERT(DATETIME, date_idem_approval, 120) 
UPDATE [DW].[APP].[tbl1]
SET    date_bid_current = CONVERT(DATETIME, date_bid_current, 120) 
UPDATE [DW].[APP].[tbl2]
SET    date_bid_current = CONVERT(DATETIME, date_bid_current, 120) 
UPDATE [DW].[APP].[tbl3]] 
SET    date_contract = CONVERT(DATETIME, date_contract, 120) 
UPDATE [DW].[APP].[tbl4]
SET    date_approval = CONVERT(DATETIME, date_approval, 120) 
ALTER TABLE [DW].[APP].[tbl]
  ALTER COLUMN date_approval DATETIME 
ALTER TABLE [DW].[APP].[tbl1]
  ALTER COLUMN date_contract DATETIME 
ALTER TABLE [DW].[APP].[tbl1]
  ALTER COLUMN date_paid DATETIME 
ALTER TABLE [DW].[APP].[tbl2]
  ALTER COLUMN date_bid_current DATETIME 
ALTER TABLE [DW].[APP].[tbl3]
  ALTER COLUMN date_bid_current DATETIME 
ALTER TABLE [DW].[APP].[tbl4]
  ALTER COLUMN date_revised DATETIME 
ALTER TABLE [DW].[APP].[tbl5]
  ALTER COLUMN date_est_start DATETIME 
ALTER TABLE [DW].[APP].[tbl5]
  ALTER COLUMN date_est_finish DATETIME 
ALTER TABLE [DW].[APP].[tbl5]
  ALTER COLUMN date_act_start DATETIME 

As per the error message i think something is wrong in the conversion of the date_revised, which i underlined in the code. Can anyoneplease tell me what is wrong with the conversion??

In the ORACLE DB the date is in the format "13-MAY-98' and on the SQL SERVER its in the format "1998-05-13 12:18:17"

Thanks



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>