- 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 Azure is a cloud-based Relational Database Management System (RDBMS) from Microsoft. Before I cover how it works and where you can use it, I’ll explain how it differs from an “on-premise” or locally-owned copy of SQL Server.
I think of technology within an organization in three big circles, which can overlap.
The first circle, there at the bottom and in the front, is “Infrastructure.” This includes power, cooling, networking, and even security appliances and software. You can think of it as the “road” a computing device needs to get from one location to another.
The second circle is the “Platform.” This includes the server hardware, printers, SANs, firmware, Software (Operating Systems and SQL Server, among others) and other components you need to provide an end-result to the users.
The final circle is “Data.” This includes structured data, like what is stored in SQL Server databases, and un-structured data such as Microsoft Office documents and text files. In this conceptual diagram, I’m not talking about the databases themselves — I’m referring to the data they hold.
These circles overlap because many of the components share parts with each other, and of course they are all dependent on each other to provide a path to a result. For instance — when a user clicks on a button in an application, the signal rides across the network using electricity (Infrastructure) to a server which holds the code for the application (Platform), makes a change to some data (Data) and returns the result to the user. With only Infrastructure, the user can’t do any meaningful work. Without Infrastructure, the application has no way to transmit the data back to the user. Without a server, the application code can’t exist anywhere.
As a technical professional, the tasks you perform each day depend largely on the circle you’re in at the time. I’ll ignore for the moment that we all work a little in each circle — for this discussion, let’s assume that you’re a “pure” Data Professional — you only write code, for instance, or manage and monitor a database Instance. Of course, that’s not all we do, but it will simplify this diagram a bit.
From our standpoint, these three circles can’t be broken up. We see an on-premise need for all three functions to provide data to our users. But from the standpoint of the developer, this isn’t always true. They can write code on almost any platform. They still need Infrastructure to move things around, and of course the “data” in this case is conceptual — they don’t care where it lives. This is also true of the organization’s owners and managers. A CEO, for instance, views the three circles as a cost, from hardware to software licenses to staff to run them all. But in fact he or she only cares that the business needs are met — not caring necessarily how that happens.
This is where, I think, the big divide comes for Data Professionals and Business People. The technical professional thinks of all of the effort for transport, optimization and security of a data path for an application; and the business people tend not to focus on that as often. Business managers are very attracted to the fact that they can quickly provision a SQL Azure system, without having to buy a server or wait for it to be configured. And they like that it is patched and upgraded in the background, all the time, with no downtime. They also want to buy more space and processing power as they need it, and stop paying for it when they don’t. This makes the platform different than an “on-premise” system that they have to buy, staff, license and maintain.
So with that explanation, I’ll explain what SQL Azure is, and then I’ll explain some places where it seems to work well within the “three circles”. It’s up to us as data professionals to help the business see where a “cloud” solution fits, and where it makes more sense to build an infrastructure and platform locally.
SQL Azure Architecture
SQL Azure is not a traditional Instance of SQL Server that runs on another system somewhere. In fact, you don’t think of an Instance at all when you talk about SQL Azure — you focus on the database level.
SQL Azure is a variant of SQL Server. However, it is a specialized Instance, so you’re not able to use your “normal” processes of managing the server. For instance, if you connect to the Azure database using SQL Server Management Studio (more on that process in a moment) you don’t need to right-click on the Instance name and make changes to memory, file locations and so on. You also don’t need to specify database parameters such as the recovery model or FileGroups using Properties or the sp_configure system stored procedure.
This can cause a bit of confusion for the data professional. Since these settings impact performance, security and so on, we often find that not having them makes us a bit nervous about using it, but I’ll explain where it fits shortly — even with these constraints.
The architecture, then, starts at the database level. You don’t connect to an Instance, you create databases. I’ll show you how to do all that in a moment. Once inside the database, you can create a more limited set of objects, but rich enough for many projects. You have tables, views, stored procedures, functions, triggers and data types available, along with users, database roles, and schemas. You also have Synonyms available.
Databases come in two sizes and types: As of this writing, a “Web” database is 1GB in size, and a “Business” database can be from 10-50GB in size, in increments of 10GB each. These databases are automatically created with the proper recovery levels, file layouts and are mirrored three times for disaster recovery. The difference is the cost for each type of database.
Speaking of disaster recovery, as of this writing there is no BACKUP DATABASE command. You can copy the data out using the bulk-copy program(bcp) utility or SQL Server Integration Services (SSIS), and you can also use “Sync Services” to perform a “trickle backup” to another location — even locally if you with. I’ll give examples of that in another tutorial.
Installing and Configuring a SQL Azure Database
Technically, you don’t “install” SQL Azure. Using a credit-card and a Windows LiveID, you connect to the Azure developer’s portal located here: https://sql.azure.com/ProjectViewer.aspx. Once you’ve laid your money down and signed in with your LiveID, you’ll be asked to create a new “Project” — which will hold one or more databases. Here is my current Projects screen:
Once you click your project name, you’re brought to the database administration panel. I’ve created the UniversalDB from a previous tutorial, and in the graphic below you can see I’ve blotted out my server and administrator’s name. You will see those on your own screen once you create a database.
To create a new database, you simply click the Create Database button and make the selection for Web or Business Databases, along with the size:
You won’t have access to the recovery level, size and placement for the data files. You don’t need to set those, since the SQL Azure system will handle that for you.
Connecting to a SQL Azure Database for Coding and Applications
With the database settings created, you have two more steps to complete to connect in to your system and begin using it. The first step is to open the TCP/IP range on SQL Azure to allow your systems to connect in. During development, I recommend you only allow the developers and administrators and testers the right to connect, and then open it further once you want to allow connections from your middle-tier or direct-connected applications.
The next step is to figure out your connection strings for the applications and your management tools. This is actually quite simple — you’ll set the administrator name and password right from the main Projects panel, and to generate a string for the database, click on the database and then click the “Connection Strings” button.
You can use those strings right in your application, and to manage and program the database.
You can connect to the database using various tools, including SQL Server 2008 R2 SQL Server Management Studio (SSMS) and a graphical interface called “Project Houston,” which you can find here: https://www.sqlazurelabs.com/houston.aspx. Here’s a shot of that running on my system:
Using SSMS 2008 R2, you connect to the database just like any other Instance of SQL Server, but you need to use the full name of the server, SQL Server Authentication, and you need to specify the name of the database to connect to. Once you do, the only differences are the icon for the server, and how many items show up on a right-click and in the object list:
You can also use the SQLCMD command-line tool from SQL Server 2008 R2 to connect to a SQL Azure database. You’ll need to supply the full server name, SQL Server authentication, and database name just as in SSMS.
As I mentioned earlier, you’ll also need to ensure you set the Firewall extensions in your SQL Azure developer’s portal to allow your workstation to connect. All of your tools will use the same TCP/IP address, so you only have to open the workstation’s IP on SQL Azure. When you’re ready to allow users into the server, you’ll need to find out how they are getting to the Internet to enter their ranges.
Use-Cases for SQL Azure
To be very clear, SQL Azure isn’t intended as a complete replacement for an on-premise system. The size limitations alone preclude that. Also, if your application requires some of the advanced features in SQL Server and Transact-SQL, they obviously won’t fit for SQL Azure. If you have huge Extract, Transform and Load (ETL) or other processes that move massive amounts of data across the network, they will also not be appropriate for SQL Azure.
SQL Azure is best evaluated in two cases: Applications with location-independence needs, and in conjunction with the Windows Azure platform.
If you have an application that needs to serve users in multiple locations, you may not want or need to provide them access to your corporate network. You can code the application to use SQL Azure and locate the data outside of your organization.
SQL Azure really shines when it is paired with Windows Azure. Windows Azure has three parts: one which serves up applications like any other server, a service-bus called the Application Fabric, and a storage offering for data. There are two types of storage in Windows Azure — a Binary Large store (called blob storage), and a key-value-pair, No-SQL — like table storage. Adding SQL Azure to that mix gives you a lot of options for mixing and matching structured and non-structured data, and as an added benefit you don’t have to pay for network bandwidth between the Windows Azure application and SQL Azure. Not only that, but since they share a datacenter and network backbone, that transfer is very fast.
To be sure, these use-cases will grow as time moves on and the product matures. It’s worth taking a few minutes and running through some of the tutorials I’ll reference at the end of this article.
InformIT Articles and Sample Chapters
Michael Miller asks the question, Are You Ready for Computing in the Cloud?
Books and eBooks
David Linthicum has an interesting take on the cloud by combining the discussion with a Service Oriented Architecture, or SOA, in his book Cloud Computing and SOA Convergence in Your Enterprise: A Step-by-Step Guide.
Online Resources
Lots of whitepapers, videos and other introduction training is here.