Tips for SQL Server Management Studio

Source: Internet
Author: User
Tags sql 2008 management studio sql server management sql server management studio
SQL Server troubleshooting tips and tricks

  • Page
  • Discussion
  • You can view its source [e] "accesskey =" E "href =" W/index. php? Title = SQL _server_troubleshooting_tips_and_tricks & Action = edit "> View Source
  • History

From sqlserverpedia: http://sqlserverpedia.com/wiki/ SQL _Server_Troubleshooting_Tips_and_Tricks jump to: navigation, search

SQL Server tweaks and tools that make a DBA's life easier

This article shares some of the tweaks and tools that can make the job of a SQL Server database administrator (DBA) easier. You'll find tips for all of the following:

Contents
  • 1 Indexes
  • 2 Keyboard shortcuts
  • 3 query execution settings
  • 4 copy Behavior
  • 5 object detail Explorer
  • 6 missing Indexes
  • 7 Author credits
  • 8 related reading

Indexes

If you use "bounded ded" columns, you know the frustration associated with figuring out which columns are supported. The following stored procedures can help:

  • Sp_helpindex-a system stored procedure that reports information about the indexes on a table or view
  • Sp_helpindex2-a rewrite of the sp_helpindex stored procedure, written by Kimberly Tripp
  • Dba_indexlookup_sp-a custom, non-system stored procedure, written by Michelle ufford

Take a look at all of these and use the one best meets your needs.

Keyboard shortcuts

To choose a keyboard scheme, in SQL Server Management Studio (SSMs), selectTools | OPTIONS... | Environment | keyboard.

Keyboard shortcuts

The "standard" keyboard scheme has the following shortcuts by default:

Alt+F1  sp_helpCtrl+1   sp_whoCtrl+1   sp_lock

Here are some suggestions for additional shortcuts:

Ctrl+3   Select Top 100 * FromCtrl+4   sp_tables @table_owner = ‘dbo’Ctrl+5   sp_columnsCtrl+6   sp_stored_procedures @sp_owner = ‘dbo’Ctrl+7   sp_spaceusedCtrl+8   sp_helptextCtrl+9   dba_indexLookup_sp or sp_helpindex2

Please note that any changes you make to these settings will not take effect until you open a new query window. Here's an example of how you cocould use these shortcuts:

  1. Use Ctrl + 4 to find a list of tables.
  2. Copy one into your query window.
  3. Highlight the table name (I usually double-click on it) and press Ctrl + 3 to view a sample of that table's data.

You may want to remove or change the schema filters if you use schemas other than DBO.

Query execution settings

SMSs offers advanced settings to help prevent unintentional issues in production environments, such as a query that causes locking or blocking. to access these options in SSMs, chooseTools | OPTIONS... | Query execution | SQL Server | advanced.

Query execution settings

Some suggestions include:

  • Change "SET transaction isolation level" to "Read uncommitted. "This will minimize the impact of your ad-hoc queries by allowing dirty reads. while this can be beneficial for production environments, make sure to understand the implications of this setting before implementing.
  • Change "Set deadlock_priority" to "low." This will tell SQL Server to select your session as the victim in the event of a deadlock.
  • Change "Set lock timeout" to a smaller, defined value, such as 30000 milliseconds (30 seconds ). by default, SQL Server will wait forever for a lock to be released. by specifying a value, SQL Server will abort after the specified timeout period when a lock is encountered.

You can also make these same setting changes in Visual Studio.

Copy Behavior

This tip is not specific to SQL Server; it's useful for any Microsoft product. Holding down "ALT" while you drag your mouse will change your selection behavior to block selection.

Block Selection

 

Object detail Explorer

The one of the great updates available in SQL Server 2008 is the object detail explorer. for example, you can quickly find the table size and row counts of all the tables in a particle database. the object detail Explorer requires SQL 2008 Management studio, but you can connect SQL 2008 SSMs to a 2005 instance. note: if these options are not visible, right-click the column headers and add them to the display.

Object detail Explorer

 

Missing Indexes

If you use SSMs 2008 to execute display estimated query plan (CTRL + l), it will show whether you're re missing any indexes. this will even work if you connect SSMs 2008 to SQL 2005.

Missing Index

Author credits

Michelle ufford

This Wiki article was adapted from a blog post by Michelle ufford.

Michelle is a SQL developer dBA for godaddy.com, where she works with high-volume, mission-critical databases. she has over a decade of experience in a variety of technical roles and has worked with SQL Server for the last 5 years. she enjoys performance tuning and maintains an active SQL Server blog.

Her online presences include:

  • Sqlserverpedia profile: sqlfool
  • Blog: http://sqlfool.com/
  • Twitter: http://twitter.com/sqlfool/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.