Tuesday, July 17, 2012

SQL Server-Results in Grid

In SQL Server Management studios while running queries, the results can displayed in text format or for better formatting the results can be displayed in Grid format. When the results are displayed in grid format the column headers with the column values are displayed. The results can be saved to .csv file/excel, let us say in case the columns need to moved in order of appearance, say the the 10th column in the result set need to be next to the first column in the result set, this can be in done in the Results in Grid Format. In order to swap the columns,
1. Click on the column header(say 10th column in the result set) that need to be moved, keep the left mouse button pressed, this would be change the background of the column header to be suppressed.


Please refer to the notes in the image where in I have used an actual example.

2. With the left mouse button pressed drag the column header and start moving it to the column header where it needs to be placed.
3. When the column header which is being moved is on top of the column header(the current 2nd column header) where it needs to be placed, release the left mouse button.
4. This would complete the movement of the column header, now the 10th column would be in the second place, the current second column would be moved by one to the third place.

No comments:

Post a Comment