SolvedPrivate

Currency format in SSIS

Posted on 2014-07-29
5
29 Views
Last Modified: 2016-02-11
I want to  output columns in a sql table to a text file in SSIS.  The price column is money  
like 9877.21 but  it should look like $      9877.21 in the text file
0
Comment
Question by:Nana Hemaa
  • 2
  • 2
5 Comments
 
LVL 15

Expert Comment

by:Vikas Garg
ID: 40228407
Hi,

You can use Derived Column and convert the Money to Varchar and Concatenate it with $ Symbol

Expression will be like this "$ " + (DT_STR,10,1252)MoneyColumn
0
 

Author Comment

by:Nana Hemaa
ID: 40228438
getting invalid expression
0
 

Author Comment

by:Nana Hemaa
ID: 40228460
run ok but ouput in text file did not change.  I want 5 leading spaces after the $   sign
like $      9877.21 .  I added derived column but still gets 9877.21.   I replaced the column name price in the derived column
0
 
LVL 12

Expert Comment

by:Harish Varghese
ID: 40228469
Above solution should work. Post a screenshot of the derived column setup.
0
 
LVL 15

Accepted Solution

by:
Vikas Garg earned 500 total points
ID: 40228475
Hi,

Replace for id column will not work since id column in not varchar and the output of derived column is varchar.

and for spaces you can add space near the $ sign

"$     " + (DT_STR,10,1252)id
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Row insertion failed. Array 5 48
Download ms sql express. 2 28
sql server query 12 26
MS SQL AND PASSING A TABLE NAME TO A SPROC 5 18
In couple weeks ago, I encountered an extremely difficult problem while deploying 2008 SSIS packages to a new environment (SQL Server 2014 standard).  My scenario is: We have one C# application that is calling 2008R2 SSIS packages to load text fi…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question