Problem with excel formatting RRS feed

  • Question

  • I have a problem with export from sql server to excel.

    The export is done from SQL Server Management Studio 2008. I run a query and right click in result pane, then “Copy with Headers” and “Save Result as”  CSV file. Every field goes ok in excel except one text field.

    The field with error is stored perfectly as varchar on sql server like this: 88:5:6:7. It seems the problem occurs when the text can be interpreted by excel as time, or something that resembles time. Some of the entries in this column in excel are ok, others are not.

    88:5:6 is shown in excel 2007 as 88:05:06, and excel 2007 formatting is automatically set as time. When I try to set formatting as text, I get a non-understandable number. If the varchar word from sql server is longer, as for instance 48:2:2:4:6, its formatting in excel is standard, and it is shown correctly.

    I think this has something to do with default templates and formatting in excel.

    How can I fix this so the text is shown in excel as stored on sql server?


    Tuesday, January 8, 2013 10:42 AM

All replies