Avatar of CiciO
CiciO

asked on 

DTS converts numbers to text during export to Excel

I have a DTS job that exports a table to a formatted Excel spreadsheet.  Even though the spreadsheet is pre-formatted as numbers, DTS converts them to text.  Is there a way around this?  I found a registry hack for TypeGuessRows but it did not seem to make a difference.
...timmy
Microsoft SQL Server

Avatar of undefined
Last Comment
CiciO
Avatar of frankytee
frankytee
Flag of Australia image

is the relevant field numeric in your table? if not then use a select statement in your dts transformation to excel

select cast(yourfield as decimal(19,2)) as yourfield,
cast(yourfield2 as int) as yourfield2,
etc....
from yourtable
Avatar of CiciO
CiciO

ASKER

Yes - the SQL data is numeric.  The problem as I undertsand it is that the JET engine used by DTS sees the column header in Excel and assumes that it should post text data in the column.
...timmy
Avatar of nmcdermaid
nmcdermaid

Two solutions that I can think of:
1. Export as CSV, which opens in Excel and doesn't have any formatting
2. Write some ActiveX script to go through the Excel file afterwards and fixes it up.
Avatar of CiciO
CiciO

ASKER

Thanks nmcdermaid,

We already have it in a CSV and we are trying to improve the presentation.  
I hadn't thought about an ActiveX script but I am still holding out hope for a solution in DTS.

...timmy
ASKER CERTIFIED SOLUTION
Avatar of nmcdermaid
nmcdermaid

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of CiciO
CiciO

ASKER

I will close now.  Thanks for your help.
Microsoft SQL Server
Microsoft SQL Server

Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.

171K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo