SolvedPrivate

Currency format in SSIS

Posted on 2014-07-29
5
27 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Creating SQL script using SQL data and SQL script 8 33
2016 SQL Licensing 7 40
SSIS with VPN COnnection 2 70
Insert query into temp tables using Coldfusion 3 12
My client has a dictionary table. They're defining a list of standard naming convention. Now, they are requiring my team to provide us a mechanism how to match new incoming data with existing data in their system.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

815 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now