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

Storing a Money data item (in SQL Server) in a double SSIS variable

$
0
0

Hi

 

I have a table in SQL Server with following spec

Table1(Grossamount(money))

 

I have a SSIS variable called grosstot of type double and use following sql in Execute SQL task in SSIS

 

Select Sum(Grossamount) from Table1

 

I then assign the result of above sql stmt to the SSIS variable grosstot within the same Execute SQL task.

 

it gives me the error :

[Execute SQL Task] Error: An error occurred while assigning a value to variable "grosstot ": "The type of the value being assigned to variable "User::grosstot " differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object. ".

 

 

I tried the following sql to no avail

 

Select CONVERT(numeric (12,2), Sum(Grossamount) from Table1

 

Your help very much appreciated


 


Viewing all articles
Browse latest Browse all 24688

Trending Articles



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