- 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
Hopefully you're a trained technical professional with lots of experience running large-scale database systems. If so, you can learn a lot about SQL Server programming and advanced concepts like Business Intelligence (BI) here at InformIT. Perhaps you're new to SQL Server and you're preparing to take over and manage one of the database platforms. Maybe you're a developer and you want to learn more about managing SQL Server. This guide is tailor-made to help you learn a great deal about SQL Server.
But perhaps your situation is a bit more dire than that. You might have a crisis on your hands, or you've been given a SQL Server system to manage with no training and only a little time to bring yourself up to speed. This article is for you.
I want to make sure that you understand the limitations you're under, and use this information accordingly. One tutorial is far too little space to make you an expert. You're not going to learn to install SQL Server properly, learn write good code or completely tune a database's performance in 10 minutes. What I'll do here is give you the base amount of information you absolutely need to know in three areas: Tools, Troubleshooting and Where to find more information. Along the way (as I've been doing already) I'll link to other articles I've written to help you learn more about that particular topic.
SQL Server Defined
I'll start with an introduction to the system itself. Look for links within this text (when you have time) to learn more – for now you need to know these basics. SQL Server is a Relational Database Management System (RDBMS) that runs on platforms as diverse as tablets and smartphones up to 64-bit Clustered Servers. In all “Editions”, SQL Server runs only on Microsoft operating systems. It can also run inside a Virtual Machine (again, the guest must be running almost any modern Microsoft operating system). By and large, that means that the database runs in one place, and lots of users access the database through programs on their desktop or through a website application. It's important to understand that while SQL Server must run in a Windows Operating system, the clients do not. They can run almost anything.
SQL Server is controlled by a set of Windows Services. The main service that starts the database is called MSSQLServer. If you see that service name followed by a $ sign and then more letters, your server has been installed more than once, called a Named Instance. An Instance is just a way of having more than one SQL Server running on a single box. Another service you'll see is called SQLServerAgent. This is a service that controls all of the automatic things that run on the server, sort of an AT command or a CRON system if you're used to those programs. If the system has automated maintenance on it (always a good idea) then you should see this service running. If you're just taking over a system, especially in a hurry, don't change anything yet.
The most likely versions you'll see of SQL Server are 2000, 2005 and 2008 and higher. I debated whether to leave the SQL Server 2000 information in this article, since at this writing it's over 11 years old. But I'll leave it here, and separate out the information into its own section. I'll show you how to check your version in a moment. If you do have SQL Server 2000 installed, you need to find out why, and then try to get it upgraded as soon as time allows.
All of the information I'll show you here is applicable to all three versions, and I'll point out the differences where they occur. That's mostly in the tool sets and abilities. For the most part, the versions of SQL Server through 2000 have tools that look similar. Version 2005 and higher uses different tools with different names. For that reason, I'll only briefly tour the graphical tools, and give you commands for the things you'll need to do that work in all three versions.
As I mentioned earlier, within the versions, there are different Editions. The Editions have to do with the limitations and capabilities. They range anywhere from the MSDE engine (in versions through 2000) and the Express edition (2005 and higher), to Personal, Standard, Workgroup (2005 and higher) and then Enterprise and Datacenter Editions. In the tools description below I'll show you how to find out which version you have.
On the security side, SQL Server can use Windows accounts to allow access to the server and then the databases and their objects (such as tables and views) or you can create new logins within SQL Server that don't require Windows accounts.
Tools
There are three methods to control SQL Server. There are graphical tools, you can type in commands, and you can write programs that control the server. Since you're in a hurry, I won't focus on the programmatic methods; I'll save those for another time.
Graphical Tools in Early Versions of SQL Server (2000 and Lower)
If you're not using SQL Server 2000, skip this section. You're in a hurry.
In versions 2000 and lower, the two tools you'll use the most are Enterprise Manager and Query Analyzer. Enterprise Manager is used to control and configure the server and databases. It is a graphical tool with a typical Microsoft Management Console layout, which has objects on the left and containers on the right. As you click an object, different things show up on the right.
You can expand or double-click objects on the left side of the tool and in some cases you're presented with sub-objects. You can right-click almost any object and locate its Properties panel, which will give you a wealth of information about it, and allow you to change the settings. Unless you know what they are for, don't.
If you right-click the Server's name and select View from the menu that appears, you can change the layout on the right-hand side to the TaskPad view. This is a web-like layout that gives you a lot of help along the way.
There are also Wizards in menu bar of Enterprise Manager under the Tools menu item that will guide you through most common tasks such as backup operations or adding users. The wizards are the safest way to perform these tasks when you're new to the platform.
Query Analyzer is also a graphical tool, but it is used primarily to enter commands to SQL Server. The language SQL Server uses is called Transact-SQL, or T-SQL for short. You'll often see it abbreviated that way in some of the resources I'll show you at the end of this article.
When you open Query Analyzer you're presented with a login screen. This wants the server name you want to connect to. If you want the main instance and you're running the tool on the server, just enter (local). That's parenthesis and all. If you have an instance on the server you want to connect to, enter the server name and the instance name like this: SERVERNAME\INSTANCENAME. Case doesn't matter. Remember, you can find that name after the $ in the Services on the Windows Server where SQL Server is running.
Depending on the settings, you'll see two areas, one on the right, and one on the left. The left are is an object-browser, and you can double-click or right-click objects for actions just as you do in Enterprise Manager.
In the right-hand pane you type commands, and spacing around the commands doesn't matter. Nothing will happen (even if you press ENTER) until you press F5 or click the green triangle. In the menu bar you'll see the name of the database you're in, which is master for the default settings. Anything you type and run happens against that database. You can pull down the menu to select another database.
If you've located the Query Analyzer tool on your server and connected to the database engine, try the following command. Type it just as I have here:
EXEC xp_msver
And then press F5 or click the green triangle. Now you've got three areas on the screen, since the results pane has opened up on the bottom. This command shows you a lot of information about the server, including the version of SQL Server you're using along with the service pack. It's the number following the dot in the return value.
Graphical Tools in SQL Server Versions 2005 and Higher
Since SQL Server 2005 both of the previous tools have been replaced with the SQL Server Management Studio, or SSMS. You can find this tool in the Windows Start menu under the SQL Server grouping – best to run this on the server if you can for this exercise.
When you open SSMS you're presented with a login screen. This wants the server name you want to connect to. If you want the main instance and you're running the tool on the server, just enter (local). That's parenthesis and all. If you have an instance on the server you want to connect to, enter the server name and the instance name like this: SERVERNAME\INSTANCENAME. Case doesn't matter. Remember, you can find that name after the $ in the Services on the Windows Server where SQL Server is running.
SSMS has tabs showing the areas on the tool, and they are configurable. You can leave them on, auto-hide them, or have the menu float. You can also turn them off completely. If that's been done on your system, access the menu bar and on the View item select at least the Object Explorer and Summary panels. If you've inherited the system from someone else, then select the Window menu item and then Reset Window Layout. This will put everything back to standard, and show you what you need to see to start with.
You can right-click almost any item to find commands associated with it. Objects might also have sub-objects in this tool as well, and each menu is different.
You can click the New Query button on the icon bar at the top of the screen to open a panel where you can type T-SQL commands. The commands don't run until you press F5 or click the Execute button.
On the Summary panel to the right you'll see a small menu selection in the top left-hand side. The Report pull-down menu has a great deal of information you can use to find out what is happening on a server or in a database. Start with the Server Dashboard for a lot of information, including the version of what you are looking at.
In SQL Server Management Studio, much of the introduction functionality is embedded in the Tasks menu item when you right-click an object. For instance, if you need to back up a database, right-click that database and select Tasks and then Backup from the floating menu, and then follow the prompts. Once inside any panel you can click the Help button if you don't understand something.
The first thing you should do is to right-click the name of the server (the topmost object) and select Properties from the menu that appears. That will give you the information you need to find the version of the operating system and SQL Server that you are running.
From there, right-click the Server name (properly called an Instance) and select the Standard Reports area. All of these are valuable, but the one I want you to focus on is the Server Dashboard. It has lots of good information, and you can export it for future reference. It will show you the versions and Editions as well.
Next, expand the Databases node on the left and right-click each database in turn, and select Reports and then Standard Reports. Once again, all of these are valuable, but the one to focus on for now (for each database) is the Backup and Restore Events report. You can actually find out about the last backups of a database in lots of ways, but this report will also help you understand the time windows you need to worry about for your system. Note down or export all of this information for later.
Troubleshooting
If you're in a panic situation and something seems to be wrong with the server responding, think long and hard about whether you should try to fix it or not. In many cases, you can actually do more harm than good, so sometimes the best course of action is to pony-up and pay for someone to come in and help. DO NOT do anything to a server until you have checked the backups. You should keep in mind at all times that if you're not an expert and the server is experiencing an issue, there is a really good chance that you could make the system lose data. That's harsh, but it's true.
If you have no choice, or you know that you have good backups and could restore the system if you had to, then you can open Enterprise Manager or SQL Server Management Studio and try to connect to it. If you can't, open the Windows Event Viewer on the server and see if there are any problems that show up regarding SQL Server. Search the Internet for the error code and investigate what's causing the problem.
If the server is running and you're having an issue with a certain database, the first thing you should do is backup all the databases on the server. You can use the wizards in the graphical tools, or use this command on the server's Operating System:
SQL Server 2000 and lower:
osql –E –d master –Q"BACKUP DATABASE foo TO DISK='C:\TEMP\foo.BAK'"
SQL Server 2005 and higher:
SQLCMD –E –d master –Q"BACKUP DATABASE foo TO DISK='C:\TEMP\foo.BAK'"
The case matters this time. The parts you should change are the foo entries. Change those to the name of each database on the server, including master, and msdb. Make sure there is enough room on the hard drive location. You can change the C:\TEMP part to whatever you need, or point it to a share on the network if you have to. If you have to send it across the network, it can take a while.
For the graphical tools, right-click the database name and select Backup (2000 and lower) or All Tasks and then Backup (2005 and higher) from the menu that appears. You can backup to tape or a local or remote disk. Make sure you have enough space to handle the backup; right-click the database name and select Properties or use those reports you exported to find out how big it is now.
We've all heard the jokes about rebooting a Microsoft product when there's a problem. In this case, a reboot really can help. SQL Server tries to find and correct any errors on startup, so once you've made a backup, reboot the server. Check the system using Enterprise Manager or SQL Server Management Studio and see if the databases are all responding properly.
Next, scan the Windows Application Event Logs to locate any warnings or stop events regarding SQL Server. Search those on the web, and don't stop at the first one you find. Some errors show up in several places, so make sure you're fixing the right problem.
Don't do anything without consulting with the users and the developers on that machine. You might read that a service pack fixes the issue you're having, but the developers might be affected if you install it blindly.
Finding More Information
My first recommendation is to visit this site and listen carefully to what my good friend Brent Ozar says about his "Blitz Script". With the basics you've done here, you should be able to follow his instructions - and he's done most of the work for you. Don't copy and paste from the article - use the "Download" script instead: http://www.brentozar.com/sql/blitz-minute-sql-server-takeovers/
Books Online (Also in the Start menu) is the primary help area for all of SQL Server. It's the complete listing of all topics and also has an index, and it's fully searchable. There's also a Favorites area that works like a browser to record links to the items you found useful.
For SQL Server 2005 and higher, you have a lot more in-product helps. Open SQL Server Management Studio, and then click Help in the menu bar. The two most useful items here are How Do I and Tutorials. When the emergency is over, spend a little time in here to learn what you need to know. If you're still in the emergency, use the Community menu item to ask people on the web to help you out.
You can also find Books Online on the web. Here's the search link for SQL Server 2005, and here's the link for searching SQL Server 2008.
There is, of course, a lot more to managing the server. Once you're out of the problem make sure you get some time to study more. There's a wealth of information right here at InformIT to help you come up to speed quickly.
Other than this guide, search the Informit site for SQL Server. You'll get articles, guides, books and online-books a-plenty to help you learn more. http://www.informit.com/guides/content.aspx?g=windowsserver&seqNum=73
I have a book on administration for you: Administrator's Guide to SQL Server 2005. Whether you're using SQL Server 2005 or higher, this is a great resource. For 2000, Essential SQL Server 2000: An Administration Handbook work should help you out.
Online Resources
The main site to start with is the SQL Server site at Microsoft. Their site will lead you to maintenance information, recovery processes, capabilities, and just about everything you ever wanted to know about SQL Server.
There are a host of other resources you can use for SQL Server. I've asked friends to help me with their favorites, and keep in mind most of these have even more links to more sites. This is by no means a complete list, but here are some of the most popular:
http://blog.stackexchange.com/