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

settng datetime varible from ado.net Query result

$
0
0

Hello friends

I need to copy data from MYSQL to SQLSERVER based on last 2 days.

Now what i do i set variable that accept last two date and i select data from MYSQL based on this variable.

for example i used

ADO.net as an connection

This Query for variable

Select DATE_FORMAT(synchDate,'%m-%d-%Y %h:%m:%s')as synchDate from
 (
SELECT cast(DATE(NOW()-INTERVAL 2 DAY) as datetime) as  synchDate)D

it returns 01-03-2013 12:01:00

variable type is DataTime and variable default value is =1/5/2013 10:50:00 AM

In the Execute SQL Task properties I've set ExecValueVariable as thevariable in which I wanted to capture the execution result.  andIn the Execute SQL Task Editor I've set the ResultSet to None.

but when i execute this it gives me Error:

Progress: Executing query "Select DATE_FORMAT(synchDate,'%m-%d-%Y %h:%m:%s')a...". - 100 percent complete.

Task Failed.

Error: The wrapper was unable to set the value of the variable specified in the ExecutionValueVariable property.


and when i used

Execute SQL Task Editor I've set the ResultSet to single row set

i get  below error.

[Execute SQL Task] Error: An error occurred while assigning a value to variable "synchDate": "Result binding by name "synchDate" is not supported for this connection type. ".


Kindly help Friends

Regards

BI_Group



Viewing all articles
Browse latest Browse all 24688

Trending Articles



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