17.06.2013 Views

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 2: Tools of the Trade<br />

Figure 2-12<br />

Results to Grid<br />

This option divides the columns and rows into a grid arrangement. Following is a list of specific things<br />

that this option gives you that the Results to Text doesn’t:<br />

❑ You can resize the column by hovering your mouse pointer on the right border of the column<br />

header, then clicking and dragging the column border to its new size. Double-clicking the right<br />

border results in the autofit for the column.<br />

❑ If you select several cells, then cut and paste them into another grid (say, <strong>Microsoft</strong> Excel), they<br />

will be treated as individual cells. (Under the Results to Text option, the cut data is pasted all<br />

into one cell.)<br />

❑ You can select just one or two columns of multiple rows. (Under Results to Text, if you select<br />

several rows, all the inner rows have every column selected; you can select only in the middle of<br />

the row for the first and last row selected.)<br />

I use this option for almost everything because I find that I usually want one of the benefits I just listed.<br />

Results to File<br />

Think of this one as largely the same as Results to Text, but instead of to screen, it routes the output directly<br />

to a file. I use this one to generate files I intend to parse using some utility or that I want to easily e-mail.<br />

sqlcmd Mode<br />

36<br />

We will discuss sqlcmd a bit more shortly. For now, suffice it to say that it is a tool that helps us run<br />

queries from a Windows command line. It has some special scripting abilities that are meant specifically for

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!