I am generating a flat text file via an SSIS package. The package reads data from a table, creates a fixed length text file and ftp's the file to a partner.
The data arrives into my table via a process that I have control over so I can make adjustments based on suggestions.
My quandry is this.
I have a two fields, lets call them: DateOfHire - was going to store as a datetime or a date, although time is irrelevant Earnings - this will always have a scale of 6 with a 2 precision i.e. decimal (6,2)
Now my question is this, since the ultimate destination of these two fields is going to be a text file, and I have to change their format before write, should I store them as what they should be stored as, i.e. a date as a date and a decimal value as a decimal or should I just make the table store varchars?
The reason I ask is this: If the date of hire is 10/07/10 -> the record in the file will be written as 100710 If the Earnings are $250.99 -> the record in the file will be written as 025099
That is the first question.
The second question is how do I convert a decimal like 250.99 into 025099 given that 9999.99 is the absolute possible maximum.
SQL Server version: 2008