Home > Articles > Data > SQL Server

SQL Server Reference Guide

Hosted by

Toggle Open Guide Table of ContentsGuide Contents

Close Table of ContentsGuide Contents

Close Table of Contents

SQL Server 2005 Management Tools

Last updated Mar 28, 2003.

SQL Server 2005 provides several tools that you can use to manage, design code and monitor your SQL Server database systems, even with the previous version of the database engine. In this tutorial I'll focus on where these tools are and how they work — but not necessarily on how you use them in each situation. In tutorials across the site I'll explain how you use them to solve problems, write code, and configure and tune your systems. As we move through the configuration tools, I'll point out where the settings are and how they are changed, but I'll explain the effects of the settings in a tutorial on configuring SQL Server.

All of the tools I'll show you in this tutorial are available on the Windows Start menu under SQL Server 2005. If you're familiar with SQL Server 2000, you'll notice quite a few new menu items. I'll cover the primary management and performance tuning tools in this tutorial, and I'll return to the development tools in the sections designated for programming and Business Intelligence.

In SQL Server 2005, the tools have a similar look and feel throughout the suite. By default all of these tools are installed on the server. You can install many of the tools on your local workstation as well, using the standard installation procedure from the SQL Server 2005 CD.

Configuration Manager

I'll start with the tools you need to configure your server. In SQL Server 2000, configuration options are set using a combination of registry entries, Windows Control Panel Applets, SQL Server Enterprise Manager, and the sp_configure stored procedure in Query Analyzer. In SQL Server 2005, all of these settings are combined into just two tools: the Configuration Manager and the Surface Area Configuration tool (SAC).

The Configuration Manager tool is a Microsoft Management Console (MMC) application that consolidates the settings involving the services and network information for SQL Server. From here you can stop and start the services for the database engine and other features such as the SQL Server Agent and Analysis Services. You can also enable or disable network protocols for SQL Server, and even change the ports the services listen on.

To change the service account or startup type for a SQL Server service, double-click the service name in the right-hand side of the panel. Clicking the Service and Advanced tabs within this panel allows you to configure startup options, locations and other information for each service.

To change the network settings for a SQL Server Instance or a SQL Server Client, expand the item and double-click the protocol name.

Each protocol has properties, settings and options based on what the protocol provides. Click on the various tabs within this panel to change a setting.

Surface Area Configuration Tool

The Surface Area Configuration tool (SAC) controls what is exposed to the network. It has two parts, one for services and connections, and the other for feature controls.

Let's begin by examining the Surface Area Configuration for Services and Connections area. There's some overlap between this part of the SAC tool and Configuration Manager, since they both contain controls for service startup type and the connections allowed on a few network protocols.

The primary difference between the tools is the way you use them. In the Configuration Manager tool you're focusing more on the way the server interacts with the network and what protocols are possible. You also have a high degree of control for the service properties. In the SAC tool you're focusing more on security, and what is exposed across the protocols.

The SAC tool shows all of the SQL Server Instances installed on a server. In my example, I have SQL Server 2000, two Instances of SQL Server 2005, an Instance of SQL Server 2005 Express Edition and Integration Services installed. Using the SAC tool you can set the perspective of by Instance or by Component by selecting one of the views from the tabs at the bottom left-hand part of this panel.

After you select and apply the settings you want in the Services and Connections area, you can change feature selections in the Surface Area Configuration for Features area from the main screen of the SAC tool.

This set of panels also shows the by Instance and by Component view tabs, and you navigate it the same way as the other panels you just saw. In this section, however, you're able to enable or disable various capabilities of the server, such as Common Language Runtime (CLR) availability, Database Mail, and the xp_cmdshell extended stored procedure.

Once you've set the options the way you like in the graphical SAC tool, you can export the settings using the SAC.EXE command-line tool. This creates an XML file of the current settings which you can import to another server by using the SAC.EXE command line tool on that server. Type SAC.EXE /? at a command line to see the various options the non-graphical tool provides.

SQL Server Management Studio

The primary interface for the Database Administrator is the SQL Server Management Studio. This tool uses a Visual Studio-based interface which provides a set of development and management tools in one location with a full editing and properties screens, scripting support and more.

When you open the tool, you're presented with a panel that allows you to select where you want to connect the tool, such as the database engine or Analysis Services. You'll also need to enter your connection information, such as the server name and your security credentials. Once you connect to the server and engine, you're presented with a screen similar to this one:

When you first launch Management Studio, it may look different on your screen than the one shown here. There are many ways to configure the screen, so you may have panels open that aren't shown or you may have them arranged differently.

There are two primary parts to the screen. The first is the Summary view area. If this isn't shown on your system, you can click the View menu and then select Summary or press F7.

In this panel you have several buttons that deal with the display content across the first tab. The first navigates up through the list, the second refreshes the panel, the third synchronizes the display panel to the Object Browser list (more on that in a moment) and the fourth filters the list based on criteria you select. The last two buttons switch between a list display of the contents and various reports and dashboards that show the status of the object.

The Summary view shows general information about the current object. Double-click any object in the List view that I've shown here to set a new focus. The Summary area will split into multiple tabs across the top as you open queries and other actions. Click any tab to bring that information to the forefront.

In this screen I've right-clicked the AdventureWorks database and selected New Query from the menu that appears. You can also click the New Query button in icon bar at the top of the screen to start a query as well, but if you do, you're asked for your connection information again.

Your query window may not look like this one based on the options set on your system. Click the Tools and then Options item in the menu bar to change features such as line numbering and fonts.

When you're working with text, the tab name will display an asterisk next to the name of the file if it isn't saved. As you're editing a line, a thin yellow line appears next to the lines that have changed since the file was last changed.

In my screen I have other panels hidden, with only their titles shown vertically. Your screen may have these panels displayed. If you would like them to hide automatically when you work with another area of the screen, click the push-pin icon in the upper right hand corner of that panel. The panel will then "slide out" when you work with it, and "slide in" when you click any other area of the screen. This is useful if you don't have a lot of screen real-estate to work with.

There are other views for these panels as well. With a panel expanded, click the small, downward-pointing arrow to show the menu of display options.

There are several panels you can show, all selectable from the View menu bar item. Two of the most important are the Registered Servers panel and the Object Browser panel.

In the Registered Servers panel you set the server names and credentials you'll use to make connections to the servers. In the top portion of the Registered Servers panel you'll see several icons that represent the type of servers and engines you can connect to.

Once you click an icon, you can right-click the title of that item (in this example I've selected Database Engine) and select New and then Server Registration... to provide the name and security credentials to connect to a new server. You can remove a server in a similar fashion. Having all of the various types of servers consolidated to one location makes it simple to keep track of what you have to administer.

The next important panel is the Object Explorer. This panel is the primary navigation aid you'll use to work with the objects on the server, as well as the server itself.

You can select an object by clicking on it once. You can expand an object if it has a plus-sign next to its name by double-clicking it or clicking once on the plus-sign. Right-clicking any object brings up a context-sensitive menu for that object.

In this graphic, I've expanded the Databases object and selected AdventureWorks. I then right-clicked that database name and selected Properties from the menu that appeared.

There are several areas within this panel that show or set information about the database. The information can be sorted or grouped, depending on the type of information. Any changes made in a panel can be saved to a set of Transact-SQL commands by clicking the Script button in the top part of the panel. A new query window is created to hold the commands. From there you can save the script or run it.

There's a lot more to this versatile environment that I'll show throughout this site.

SQLCMD

The SQLCMD tool is an operating system command-line based query tool. With it you can connect to a server and run a command and receive the output on the current command window. You can also run a script from a file, send the results to a file, and even use variables with it. To see all the options, drop to a command-line in the operating system where the tool is installed and type SQLCMD /?.

SQL Profiler

The SQL Server Profiler tool shows activity on a server. It's a kind of "SQL Sniffer" in that it can read the information going to and from a SQL Server Database Engine or Analysis Services server. It functions similarly to the tool by the same name in SQL Server 2000, although in this version you can include Windows Performance Monitor objects and counters so that you can observer platform information along with the SQL Server activity to correlate the two. Using this feature you can determine what T-SQL statement is running when the processor or memory load is high.

Database Tuning Advisor

In SQL Server 2000, you could monitor activity for index performance issues with a tool called the Index Tuning Wizard. In SQL Server 2005, this capability is enhanced with the Database Tuning Advisor. Available as a tool of its own or from within SQL Server Management Studio, this tool can tune not only indexes but the physical layout as well.

The process is to start the tool while a set of operations are run on the server. This process is normally done on a testing server, but one similar in size and capability to the production server. Once the activity completes, the Database Tuning Advisor will make suggestions on everything from table arrangements to filegroup and index layouts, based on settings you choose.

I'll explain how to use the Database Tuning Advisor along with SQL Server Profiler to tune and optimize your SQL Server 2005 instances in another tutorial.

Informit Articles and Sample Chapters

If you'd like to learn a little more about the Visual Studio Integrated Development Environment capabilities you should check out this free chapter on Visual Studio.NET by Paul D. Sheriff and Ken Getz.

Online Resources

Although it's on the beta releases, this article by Marcin Policht explains the tools from a little different angle.