Reputation: 53
I queried select statement in SQL Server in grid view, and tried pasting the data into Excel. There were many columns, but when pasting into Excel, the data shows up in a single column. Can't understand why
Upvotes: 0
Views: 2205
Reputation: 33
This started to happen after I used [Data > text-to-column] in Excel with option "delimited", then unchecked "tabulation". Once I use it again, leaving "tabulation" checked, all pasting grid data resumed operating normally.
Upvotes: 1
Reputation: 188
Make sure in SSMS the output of the query is displayed in Grid View. Copy from grid view to excel. I actually use this very often, it always works.
Upvotes: 0
Reputation: 2528
You'll need to use text-to-columns in Excel after you've pasted your data in. Data > Text to columns.
Then the next time you paste it should keep the correct format.
I've also had luck with restarting both Excel and SSMS to fix the problem.
Upvotes: 0