SQLTeam.com | Weblogs | Forums

Data type number format - Excel output

I execute a stored procedure and the results are saved in an Excel (.xlsx) file for email distribution. All the numeric values appear as text format in the Excel file. I tried different data types in the stored proc i.e. INT, DECIMAL, NUMERIC but the results are still in text format. Is there anything I can change in the stored proc to change the output in Excel to number format, or is this an Excel issue?

It's an Excel issue. You could probably write an Excel macro to reformat the cells to your liking, but without knowing how you generate the Excel file I can't say how viable that is. If you're generating from SSIS or SSRS the adding a macro isn't possible.