July 22, 2009 at 2:57 am
I have a setup as below:
I have a stored proc which pulls data from various tables and returns a resultset -> this stored proc is configured in a component which takes in the resultset and simply exports it to a excel sheet.
Now, all the values from the resultset even numeric are casted to varchar and passed to the component. When the component exports the resultset to excel, the format of all fields are received as 'General'. Now, when I have any value that has preceding zeroes like 0012345, then in the excel these zeroes are removed and stored as 12345.
My problem is I want to retain these zeroes as this data is used for further processing. I cannot manipulate anything in the excel or the component that does the exporting. I have the liberty to only work on the stored proc.
Passing the value as '0012345' with quotes, preserves the zeroes in excel but, even in excel the value would be '0012345'. Again here, the value should not have quotes since this is used for further processing by another framework.
What can I do in the stored proc so that when it is exported, the preceding zeroes are preserved?
July 22, 2009 at 9:36 am
Someone please give some ideas
July 22, 2009 at 9:51 am
...stored proc is configured in a component which takes in the resultset and simply exports it to a excel sheet.
Is this in SSIS or is the stored procedure itself exporting to an excel spreadsheet?
July 22, 2009 at 10:28 pm
It is not SSIS, it is a Java component built to only export data to any given format.
July 23, 2009 at 8:36 am
I cannot manipulate anything in the excel or the component that does the exporting. I have the liberty to only work on the stored proc.
Well, then it seems to me that all you really have the ability to do is change the data types that the stored procedure exports. If you have tried various data types, and nothing works, then I'm not really sure what you can do, based on the earlier statement.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply