Women Don’t Ask: Negotiation and the Gender Divide by Linda Babcock and Sarah Laschever — Pages Unbound | Book Reviews & Discussions

Quote

Information Goodreads: Women Don’t Ask: Negotiation and the Gender Divide Series: None Source: Library Published: 2003 Official Summary When Linda Babcock asked why so many male graduate students were teaching their own courses and most female students were assigned as assistants, her dean said: “More men ask. The women just don’t ask.” It turns out […]

via Women Don’t Ask: Negotiation and the Gender Divide by Linda Babcock and Sarah Laschever — Pages Unbound | Book Reviews & Discussions

SQL Server Management Studio Query Shortcuts

Back in the day, with the introduction of programs like Word and Excel, I used keyboard shortcuts to make my job easier.  Then we started using a mouse and reduced the number of keyboard shortcuts I used.  It took me a long time to switch from the keyboard shortcuts to the mouse.  Now I am back to using shortcuts, especially in SQL Server Management Studio (SSMS).  Microsoft allows users to create shortcuts that, if you use them, could make your job easier.  Setting up the shortcuts in SSMS are pretty simple.

 

Tools > Options > Environment>Keyboard>Query Shortcuts

queryshortcuts

 

The three default shortcuts available to everyone are listed below.  These shortcuts are locked and cannot be changed by the user.

ALT+F1   sp_help Returns information about a database object or data type
CTRL+1   sp_who Returns information about current users, sessions and processes.
CTRL+2   sp_lock Returns information about locks

Other shortcuts can be set up under the available keystrokes.  You can create a shortcut for queries or stored procedures that you run often.  The example below is a query that I run often to see what jobs are currently running.  Note that to add it as a shortcut, the code needs to be on one line.

I added this query as CTRL+4 in SSMS.  Hit CTRL+4 (or the shortcut keystroke you designate) to run the job.  That is a lot easier than looking up the code, copying it or writing it out again, and running it every time you need to run the query.

querytsql

 

queryctrl4

 

If you want to select all of the records from a table, create a shortcut keystroke using SELECT * FROM as the stored procedure.  Enter the name of the table in the Query Editor, highlight the table name, and click CTRL+3 (or whatever shortcut keystroke you designate).  The results will appear in the results tab.

queryctrl3

 

SQL Server Management Studio Display Tips and Tricks

SQL Server Management Studio (SSMS) out of the box is good, but users can modify the settings to meet their specific needs.  Depending on your work load and your preferences, you can modify the appearance of SSMS.

For instance, have you ever been attending a presentation and not able to see what is being presented?  There are several variables that can be changed in SSMS to make it easier for the viewers to see the presentation.  Buck Woody wrote a blog in 2010 discussing the different variables recommended be changed if you are doing a presentation.    These are good for a presentation or just to have as your default settings.  (https://blogs.msdn.microsoft.com/buckwoody/2010/11/11/setting-up-sql-server-management-studio-for-teaching-or-demos/)

  • Tools > Options >
    • Environment>General-Startup: Open Object Explorer and Query Window. Opens both the Object Explorer and a new query window when you first connect to SQL Server.

OpenObjectExplorer

  • Environment>Fonts and Colors:
    • Font size set to 12. The default font size is 10.  This makes the text size in the query window a little easier to read.  If you want/need, you can set the font even a little bigger.
    • Item Background set to pale yellow color. This is good for presentations as it makes the code easier to see.  Some people like to use this as their default.  I prefer to have the default white background and only use the yellow background for presentations.

fontsize

 

  • Text Editor>All Languages>General:
    • Word Wrap-Show visual glyphs
    • Line Numbers

wordwrap

By default, Word Wrap is turned off.  Depending on your screen size and the code you are working with, it can go off the screen to the right and you are not able to read everything without scrolling to the right.  In the example below, there is the same code with and without Word Wrap.  It will adjust to the size of your query window.  The characters on the right hand side are the ‘visual glyphs’ identifying where the word wrap has been applied.

visualglyphs
Turning on the line numbers is useful, especially when you are working with a long stored procedure/piece of code.  This is one of the first features I make sure is turned on when helping others troubleshoot code.

linenumber

  • Query Results>SQL Server>Results to Grid:
    • Display results in a separate tab
    • Switch to results tab

Query results, messages and execution plans are displayed in tabs in the lower half of the query window after execution. To make the result set view more effective, configure them to open in a new separate tab rather than in the lower part of the query editor.

When you have both set (Display Results in a separate tab and Switch to Results Tab), after execution, the Results tab will open.  You can then quickly and easily flip back and forth between editor, results, and messages.

 

queryresults