0

I have an SQL query that returns several things, including the date and time that an email was sent, as well as the body of that email. However, when I copy and paste the data to Excel, the body of the email does not stay in one cell, but takes up several cells, many times spanning several rows. I have not used text-to-columns recently.

Does anyone know how to remedy this?

Thanks!

reggie86
  • 279
  • 3
  • 4
  • 16
  • Did you verify that it is actually in those columns and not just overflowing out of the one column? Sometimes text that is longer than the column width can appear to be taking up more than one cell. – Missy Aug 30 '16 at 14:37
  • Seems likely that particular characters are used in the text, such as ; or ", that are interfering with the way that Excel tracks rows and cell delimiters. Take a look here: http://stackoverflow.com/questions/7382846/exporting-data-from-sql-server-express-to-csv-need-quoting-and-escaping – TPhe Aug 30 '16 at 14:41
  • Hit F2 in the cell and then paste? – Tim Williams Aug 30 '16 at 17:37

1 Answers1

1

If you import data from 'Data' -> 'New Query' -> 'From Database' -> 'From Sql Server database' -> Provide your server name, database name and sql query to import data into excel, will get single attribute values to single column in excel

Kannan Kandasamy
  • 13,405
  • 3
  • 25
  • 38