Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 source int/money datatype to one column

Author  Topic 

vasu4us
Posting Yak Master

102 Posts

Posted - 2007-06-14 : 09:39:54
Hi,
i am trying to load output of count(X) and sum(salesamt) into the same column. if iam using transformation data task what datatype should i be converting the two outputs to accomidate result as

10.00 --count
234.00 --saleamt
22.00 --count
1000.00 --saleamt

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-06-14 : 10:10:58

Select count(col) from table group by somecol
union all
Select sum(col) from table group by somecol


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

vasu4us
Posting Yak Master

102 Posts

Posted - 2007-06-14 : 11:00:33
thanks MADHIVANAN for the quick responce but iam doing this in a package my pkg runs in a loop to grab one column at a time
the first 2 times it is using a count() function and 3rd time its sum().
result is stored in a fact table with ids like this

SRVR_ID CNTRY_ID METRIC_VALUE
1 101 10 (FIRSTCOUNT RESULT)
1 101 30 (SECOND COUNT RESULT)
1 101 2500.00 (SUM OF DOLLER AMOUNT)
2 102 50
2 102 20
2 102 3000.00

SOURCE SYSTEM HAS DOLLERAMOUNT IN DATATYPE-MONEY WHICH I WANT TO STORE ALONG WITH THE INT RESULTS
WHAT DATATYPE SHOULD I CHOOSE FOR ALL THE THREE COLUMNS IF IAM USING A TRANSFORMATION DATA TASK IN THE PKG
OR
SHOULD I CHANGE THE DATATYPE IN THE SELECT STATEMENT AT EXTRACT TIME.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-06-15 : 06:28:12
I think you can make use of float or decimal datatype

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -