- SQL Server Reference Guide
- Introduction
- SQL Server Reference Guide Overview
- Table of Contents
- Microsoft SQL Server Defined
- SQL Server Editions
- SQL Server Access
- Informit Articles and Sample Chapters
- Online Resources
- Microsoft SQL Server Features
- SQL Server Books Online
- Clustering Services
- Data Transformation Services (DTS) Overview
- Replication Services
- Database Mirroring
- Natural Language Processing (NLP)
- Analysis Services
- Microsot SQL Server Reporting Services
- XML Overview
- Notification Services for the DBA
- Full-Text Search
- SQL Server 2005 - Service Broker
- Using SQL Server as a Web Service
- SQL Server Encryption Options Overview
- SQL Server 2008 Overview
- SQL Server 2008 R2 Overview
- SQL Azure
- The Utility Control Point and Data Application Component, Part 1
- The Utility Control Point and Data Application Component, Part 2
- Microsoft SQL Server Administration
- The DBA Survival Guide: The 10 Minute SQL Server Overview
- Preparing (or Tuning) a Windows System for SQL Server, Part 1
- Preparing (or Tuning) a Windows System for SQL Server, Part 2
- Installing SQL Server
- Upgrading SQL Server
- SQL Server 2000 Management Tools
- SQL Server 2005 Management Tools
- SQL Server 2008 Management Tools
- SQL Azure Tools
- Automating Tasks with SQL Server Agent
- Run Operating System Commands in SQL Agent using PowerShell
- Automating Tasks Without SQL Server Agent
- Storage – SQL Server I/O
- Service Packs, Hotfixes and Cumulative Upgrades
- Tracking SQL Server Information with Error and Event Logs
- Change Management
- SQL Server Metadata, Part One
- SQL Server Meta-Data, Part Two
- Monitoring - SQL Server 2005 Dynamic Views and Functions
- Monitoring - Performance Monitor
- Unattended Performance Monitoring for SQL Server
- Monitoring - User-Defined Performance Counters
- Monitoring: SQL Server Activity Monitor
- SQL Server Instances
- DBCC Commands
- SQL Server and Mail
- Database Maintenance Checklist
- The Maintenance Wizard: SQL Server 2000 and Earlier
- The Maintenance Wizard: SQL Server 2005 (SP2) and Later
- The Web Assistant Wizard
- Creating Web Pages from SQL Server
- SQL Server Security
- Securing the SQL Server Platform, Part 1
- Securing the SQL Server Platform, Part 2
- SQL Server Security: Users and other Principals
- SQL Server Security – Roles
- SQL Server Security: Objects (Securables)
- Security: Using the Command Line
- SQL Server Security - Encrypting Connections
- SQL Server Security: Encrypting Data
- SQL Server Security Audit
- High Availability - SQL Server Clustering
- SQL Server Configuration, Part 1
- SQL Server Configuration, Part 2
- Database Configuration Options
- 32- vs 64-bit Computing for SQL Server
- SQL Server and Memory
- Performance Tuning: Introduction to Indexes
- Statistical Indexes
- Backup and Recovery
- Backup and Recovery Examples, Part One
- Backup and Recovery Examples, Part Two: Transferring Databases to Another System (Even Without Backups)
- SQL Profiler - Reverse Engineering An Application
- SQL Trace
- SQL Server Alerts
- Files and Filegroups
- Partitioning
- Full-Text Indexes
- Read-Only Data
- SQL Server Locks
- Monitoring Locking and Deadlocking
- Controlling Locks in SQL Server
- SQL Server Policy-Based Management, Part One
- SQL Server Policy-Based Management, Part Two
- SQL Server Policy-Based Management, Part Three
- Microsoft SQL Server Programming
- An Outline for Development
- Database
- Database Services
- Database Objects: Databases
- Database Objects: Tables
- Database Objects: Table Relationships
- Database Objects: Keys
- Database Objects: Constraints
- Database Objects: Data Types
- Database Objects: Views
- Database Objects: Stored Procedures
- Database Objects: Indexes
- Database Objects: User Defined Functions
- Database Objects: Triggers
- Database Design: Requirements, Entities, and Attributes
- Business Process Model Notation (BPMN) and the Data Professional
- Business Questions for Database Design, Part One
- Business Questions for Database Design, Part Two
- Database Design: Finalizing Requirements and Defining Relationships
- Database Design: Creating an Entity Relationship Diagram
- Database Design: The Logical ERD
- Database Design: Adjusting The Model
- Database Design: Normalizing the Model
- Creating The Physical Model
- Database Design: Changing Attributes to Columns
- Database Design: Creating The Physical Database
- Database Design Example: Curriculum Vitae
- NULLs
- The SQL Server Sample Databases
- The SQL Server Sample Databases: pubs
- The SQL Server Sample Databases: NorthWind
- The SQL Server Sample Databases: AdventureWorks
- The SQL Server Sample Databases: Adventureworks Derivatives
- UniversalDB: The Demo and Testing Database, Part 1
- UniversalDB: The Demo and Testing Database, Part 2
- UniversalDB: The Demo and Testing Database, Part 3
- UniversalDB: The Demo and Testing Database, Part 4
- Getting Started with Transact-SQL
- Transact-SQL: Data Definition Language (DDL) Basics
- Transact-SQL: Limiting Results
- Transact-SQL: More Operators
- Transact-SQL: Ordering and Aggregating Data
- Transact-SQL: Subqueries
- Transact-SQL: Joins
- Transact-SQL: Complex Joins - Building a View with Multiple JOINs
- Transact-SQL: Inserts, Updates, and Deletes
- An Introduction to the CLR in SQL Server 2005
- Design Elements Part 1: Programming Flow Overview, Code Format and Commenting your Code
- Design Elements Part 2: Controlling SQL's Scope
- Design Elements Part 3: Error Handling
- Design Elements Part 4: Variables
- Design Elements Part 5: Where Does The Code Live?
- Design Elements Part 6: Math Operators and Functions
- Design Elements Part 7: Statistical Functions
- Design Elements Part 8: Summarization Statistical Algorithms
- Design Elements Part 9:Representing Data with Statistical Algorithms
- Design Elements Part 10: Interpreting the Data—Regression
- Design Elements Part 11: String Manipulation
- Design Elements Part 12: Loops
- Design Elements Part 13: Recursion
- Design Elements Part 14: Arrays
- Design Elements Part 15: Event-Driven Programming Vs. Scheduled Processes
- Design Elements Part 16: Event-Driven Programming
- Design Elements Part 17: Program Flow
- Forming Queries Part 1: Design
- Forming Queries Part 2: Query Basics
- Forming Queries Part 3: Query Optimization
- Forming Queries Part 4: SET Options
- Forming Queries Part 5: Table Optimization Hints
- Using SQL Server Templates
- Transact-SQL Unit Testing
- Index Tuning Wizard
- Unicode and SQL Server
- SQL Server Development Tools
- The SQL Server Transact-SQL Debugger
- The Transact-SQL Debugger, Part 2
- Basic Troubleshooting for Transact-SQL Code
- An Introduction to Spatial Data in SQL Server 2008
- Performance Tuning
- Performance Tuning SQL Server: Tools and Processes
- Performance Tuning SQL Server: Tools Overview
- Creating a Performance Tuning Audit - Defining Components
- Creating a Performance Tuning Audit - Evaluation Part One
- Creating a Performance Tuning Audit - Evaluation Part Two
- Creating a Performance Tuning Audit - Interpretation
- Creating a Performance Tuning Audit - Developing an Action Plan
- Understanding SQL Server Query Plans
- Performance Tuning: Implementing Indexes
- Performance Monitoring Tools: Windows 2008 (and Higher) Server Utilities, Part 1
- Performance Monitoring Tools: Windows 2008 (and Higher) Server Utilities, Part 2
- Performance Monitoring Tools: Windows System Monitor
- Performance Monitoring Tools: Logging with System Monitor
- Performance Monitoring Tools: User Defined Counters
- General Transact-SQL (T-SQL) Performance Tuning, Part 1
- General Transact-SQL (T-SQL) Performance Tuning, Part 2
- General Transact-SQL (T-SQL) Performance Tuning, Part 3
- Performance Monitoring Tools: An Introduction to SQL Profiler
- Performance Tuning: Introduction to Indexes
- Performance Monitoring Tools: SQL Server 2000 Index Tuning Wizard
- Performance Monitoring Tools: SQL Server 2005 Database Tuning Advisor
- Performance Monitoring Tools: SQL Server Management Studio Reports
- Performance Monitoring Tools: SQL Server 2008 Activity Monitor
- The SQL Server 2008 Management Data Warehouse and Data Collector
- Performance Monitoring Tools: Evaluating Wait States with PowerShell and Excel
- Practical Applications
- Choosing the Back End
- The DBA's Toolbox, Part 1
- The DBA's Toolbox, Part 2
- Scripting Solutions for SQL Server
- Building a SQL Server Lab
- Using Graphics Files with SQL Server
- Enterprise Resource Planning
- Customer Relationship Management (CRM)
- Building a Reporting Data Server
- Building a Database Documenter, Part 1
- Building a Database Documenter, Part 2
- Data Management Objects
- Data Management Objects: The Server Object
- Data Management Objects: Server Object Methods
- Data Management Objects: Collections and the Database Object
- Data Management Objects: Database Information
- Data Management Objects: Database Control
- Data Management Objects: Database Maintenance
- Data Management Objects: Logging the Process
- Data Management Objects: Running SQL Statements
- Data Management Objects: Multiple Row Returns
- Data Management Objects: Other Database Objects
- Data Management Objects: Security
- Data Management Objects: Scripting
- Powershell and SQL Server - Overview
- PowerShell and SQL Server - Objects and Providers
- Powershell and SQL Server - A Script Framework
- Powershell and SQL Server - Logging the Process
- Powershell and SQL Server - Reading a Control File
- Powershell and SQL Server - SQL Server Access
- Powershell and SQL Server - Web Pages from a SQL Query
- Powershell and SQL Server - Scrubbing the Event Logs
- SQL Server 2008 PowerShell Provider
- SQL Server I/O: Importing and Exporting Data
- SQL Server I/O: XML in Database Terms
- SQL Server I/O: Creating XML Output
- SQL Server I/O: Reading XML Documents
- SQL Server I/O: Using XML Control Mechanisms
- SQL Server I/O: Creating Hierarchies
- SQL Server I/O: Using HTTP with SQL Server XML
- SQL Server I/O: Using HTTP with SQL Server XML Templates
- SQL Server I/O: Remote Queries
- SQL Server I/O: Working with Text Files
- Using Microsoft SQL Server on Handheld Devices
- Front-Ends 101: Microsoft Access
- Comparing Two SQL Server Databases
- English Query - Part 1
- English Query - Part 2
- English Query - Part 3
- English Query - Part 4
- English Query - Part 5
- RSS Feeds from SQL Server
- Using SQL Server Agent to Monitor Backups
- Reporting Services - Creating a Maintenance Report
- SQL Server Chargeback Strategies, Part 1
- SQL Server Chargeback Strategies, Part 2
- SQL Server Replication Example
- Creating a Master Agent and Alert Server
- The SQL Server Central Management System: Definition
- The SQL Server Central Management System: Base Tables
- The SQL Server Central Management System: Execution of Server Information (Part 1)
- The SQL Server Central Management System: Execution of Server Information (Part 2)
- The SQL Server Central Management System: Collecting Performance Metrics
- The SQL Server Central Management System: Centralizing Agent Jobs, Events and Scripts
- The SQL Server Central Management System: Reporting the Data and Project Summary
- Time Tracking for SQL Server Operations
- Migrating Departmental Data Stores to SQL Server
- Migrating Departmental Data Stores to SQL Server: Model the System
- Migrating Departmental Data Stores to SQL Server: Model the System, Continued
- Migrating Departmental Data Stores to SQL Server: Decide on the Destination
- Migrating Departmental Data Stores to SQL Server: Design the ETL
- Migrating Departmental Data Stores to SQL Server: Design the ETL, Continued
- Migrating Departmental Data Stores to SQL Server: Attach the Front End, Test, and Monitor
- Tracking SQL Server Timed Events, Part 1
- Tracking SQL Server Timed Events, Part 2
- Patterns and Practices for the Data Professional
- Managing Vendor Databases
- Consolidation Options
- Connecting to a SQL Azure Database from Microsoft Access
- SharePoint 2007 and SQL Server, Part One
- SharePoint 2007 and SQL Server, Part Two
- SharePoint 2007 and SQL Server, Part Three
- Querying Multiple Data Sources from a Single Location (Distributed Queries)
- Importing and Exporting Data for SQL Azure
- Working on Distributed Teams
- Professional Development
- Becoming a DBA
- Certification
- DBA Levels
- Becoming a Data Professional
- SQL Server Professional Development Plan, Part 1
- SQL Server Professional Development Plan, Part 2
- SQL Server Professional Development Plan, Part 3
- Evaluating Technical Options
- System Sizing
- Creating a Disaster Recovery Plan
- Anatomy of a Disaster (Response Plan)
- Database Troubleshooting
- Conducting an Effective Code Review
- Developing an Exit Strategy
- Data Retention Strategy
- Keeping Your DBA/Developer Job in Troubled Times
- The SQL Server Runbook
- Creating and Maintaining a SQL Server Configuration History, Part 1
- Creating and Maintaining a SQL Server Configuration History, Part 2
- Creating an Application Profile, Part 1
- Creating an Application Profile, Part 2
- How to Attend a Technical Conference
- Tips for Maximizing Your IT Budget This Year
- The Importance of Blue-Sky Planning
- Application Architecture Assessments
- Transact-SQL Code Reviews, Part One
- Transact-SQL Code Reviews, Part Two
- Cloud Computing (Distributed Computing) Paradigms
- NoSQL for the SQL Server Professional, Part One
- NoSQL for the SQL Server Professional, Part Two
- Object-Role Modeling (ORM) for the Database Professional
- Business Intelligence
- BI Explained
- Developing a Data Dictionary
- BI Security
- Gathering BI Requirements
- Source System Extracts and Transforms
- ETL Mechanisms
- Business Intelligence Landscapes
- Business Intelligence Layouts and the Build or Buy Decision
- A Single Version of the Truth
- The Operational Data Store (ODS)
- Data Marts – Combining and Transforming Data
- Designing Data Elements
- The Enterprise Data Warehouse — Aggregations and the Star Schema
- On-Line Analytical Processing (OLAP)
- Data Mining
- Key Performance Indicators
- BI Presentation - Client Tools
- BI Presentation - Portals
- Implementing ETL - Introduction to SQL Server 2005 Integration Services
- Building a Business Intelligence Solution, Part 1
- Building a Business Intelligence Solution, Part 2
- Building a Business Intelligence Solution, Part 3
- Tips and Troubleshooting
- SQL Server and Microsoft Excel Integration
- Tips for the SQL Server Tools: SQL Server 2000
- Tips for the SQL Server Tools – SQL Server 2005
- Transaction Log Troubles
- SQL Server Connection Problems
- Orphaned Database Users
- Additional Resources
- Tools and Downloads
- Utilities (Free)
- Tool Review (Free): DBDesignerFork
- Aqua Data Studio
- Microsoft SQL Server Best Practices Analyzer
- Utilities (Cost)
- Quest Software's TOAD for SQL Server
- Quest Software's Spotlight on SQL Server
- SQL Server on Microsoft's Virtual PC
- Red Gate SQL Bundle
- Microsoft's Visio for Database Folks
- Quest Capacity Manager
- SQL Server Help
- Visual Studio Team Edition for Database Professionals
- Microsoft Assessment and Planning Solution Accelerator
- Aggregating Server Data from the MAPS Tool
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.