SQL 2008 WPD-WorthTheWait
SQL 2008 WPD-WorthTheWait
SQL 2008 WPD-WorthTheWait
WHITE PAPER
© 2010 Quest Software, Inc.
ALL RIGHTS RESERVED.
This document contains proprietary information protected by copyright. No part of this document may be reproduced
or transmitted in any form or by any means, electronic or mechanical, including photocopying and recording for any
purpose without the written permission of Quest Software, Inc. (“Quest”).
The information in this document is provided in connection with Quest products. No license, express or implied, by
estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of
Quest products. EXCEPT AS SET FORTH IN QUEST'S TERMS AND CONDITIONS AS SPECIFIED IN THE
LICENSE AGREEMENT FOR THIS PRODUCT, QUEST ASSUMES NO LIABILITY WHATSOEVER AND
DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL QUEST BE LIABLE FOR ANY
DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING,
WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION OR LOSS OF
INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF QUEST HAS
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Quest makes no representations or warranties with
respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to
specifications and product descriptions at any time without notice. Quest does not make any commitment to update
the information contained in this document.
If you have any questions regarding your potential use of this material, contact:
Refer to our Web site for regional and international office information.
Trademarks
Quest, Quest Software, the Quest Software logo, AccessManager, ActiveRoles, Aelita, Akonix, AppAssure,
Benchmark Factory, Big Brother, BridgeAccess, BridgeAutoEscalate, BridgeSearch, BridgeTrak, BusinessInsight,
ChangeAuditor, ChangeManager, Defender, DeployDirector, Desktop Authority, DirectoryAnalyzer,
DirectoryTroubleshooter, DS Analyzer, DS Expert, Foglight, GPOADmin, Help Desk Authority, Imceda, IntelliProfile,
InTrust, Invirtus, iToken, I/Watch, JClass, Jint, JProbe, LeccoTech, LiteSpeed, LiveReorg, LogADmin, MessageStats,
Monosphere, MultSess, NBSpool, NetBase, NetControl, Npulse, NetPro, PassGo, PerformaSure, Point,Click,Done!,
PowerGUI, Quest Central, Quest vToolkit, Quest vWorkSpace, ReportADmin, RestoreADmin, ScriptLogic, Security
Lifecycle Map, SelfServiceADmin, SharePlex, Sitraka, SmartAlarm, Spotlight, SQL Navigator, SQL Watch, SQLab,
Stat, StealthCollect, Storage Horizon, Tag and Follow, Toad, T.O.A.D., Toad World, vAutomator, vControl,
vConverter, vFoglight, vOptimizer, vRanger, Vintela, Virtual DBA, VizionCore, Vizioncore vAutomation Suite,
Vizioncore vBackup, Vizioncore vEssentials, Vizioncore vMigrator, Vizioncore vReplicator, WebDefender, Webthority,
Xaffire, and XRT are trademarks and registered trademarks of Quest Software, Inc in the United States of America
and other countries. Other trademarks and registered trademarks used in this guide are property of their respective
owners.
Updated—January 2008
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 2
Contents
Introduction .................................................................................................................................................................... 4
10. SQL Improvements .................................................................................................................................................. 5
GROUPING SETS...................................................................................................................................................... 5
MERGE Statement ..................................................................................................................................................... 6
9. Developer Improvements ........................................................................................................................................... 8
Language Integrated Query (LINQ) ............................................................................................................................ 8
Table-Valued Parameters (TVPs)...............................................................................................................................9
8. Reporting Services (RS) Improvements ................................................................................................................... 10
Dropping the Internet Information Server (IIS) Requirement .................................................................................... 10
Reporting Improvements .......................................................................................................................................... 10
Performance Improvements ..................................................................................................................................... 10
7. Compression ............................................................................................................................................................ 11
Data Compression .................................................................................................................................................... 11
Backup Compression ............................................................................................................................................... 11
6. Data Types and Data Storage .................................................................................................................................. 12
Data Types ............................................................................................................................................................... 12
Data Storage ............................................................................................................................................................ 13
5. Security .................................................................................................................................................................... 14
Transparent Data Encryption (TDE) ......................................................................................................................... 14
Extensible Key Management .................................................................................................................................... 14
4. Resource Governor .................................................................................................................................................. 15
3. Auditing and Change Tracking ................................................................................................................................. 17
Audit Object .............................................................................................................................................................. 17
DDL Triggers ............................................................................................................................................................ 18
2. Analysis Services (AS) Performance Improvements ................................................................................................ 19
1. Multi-Server Management ........................................................................................................................................ 20
Streamlined Installation ............................................................................................................................................ 20
Policy-Based Management (PBM)............................................................................................................................ 20
Conclusion ................................................................................................................................................................... 22
About the Author .......................................................................................................................................................... 23
About Quest Software, Inc. .......................................................................................................................................... 24
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 3
Introduction
SQL Server 2008, scheduled for release in the first half of 2008, is intended to provide a comprehensive data platform
for both structured and unstructured data that is more secure, reliable, manageable, and scalable than previous
releases. In addition, SQL Server 2008 pushes the envelope with powerful new features for developers, enabling them
to create new applications that store and consume all sorts of data on everything from tiny mobile devices to corporate
“big iron” servers. SQL Server 2008 also provides a number of new features to turn all of that data into actionable
information that enables your users to make informed decisions with new levels of insight and prescience.
SQL Server 2008, like SQL Server 2005, provides a plethora of new features and capabilities, as well as the usual
bevy of bug fixes and performance improvements. Microsoft, however, has identified three areas where they’re
focusing their improvements:
• Trustworthiness of the platform, its data, and its users: provide the security, reliability, and scalability
that are required by the most demanding business applications
• Productivity of database administrators and developers: offer an array of new data-driven management
solutions that reduce the time and cost of managing and developing applications
• Business intelligence: provide a comprehensive platform for delivering and consuming intelligence when
and where your users want it
That’s how Microsoft has divided up the main elements of their marketing thrust for SQL Server 2008. However, as a
working DBA and developer, my mind is not on the marketing as much as it is on the particulars within SQL Server 2008
that will make my life easier and solve my particular points of pain. With that in mind, this white paper will introduce you
to the top ten features and capabilities in SQL Server 2008 that I find to be the most exciting and valuable:
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 4
10. SQL Improvements
I just can’t help it that SQL is so important for me. I am, after all, the author of O’Reilly’s SQL in a Nutshell, one of the
industry’s leading reference manuals on SQL. However, if you’re a full time DBA or developer, you also need to know
SQL well. Two new elements of SQL included in SQL Server 2008 that are most exciting to me are the GROUPING
SETS operator and the MERGE statement. Let’s talk about each of these new features in more detail.
GROUPING SETS
The GROUPING SETS operator is an extension to the ANSI SQL 2006 standard of the GROUP BY clause that lets
you define multiple groupings in the same query. Several other database platforms already support grouping sets.
GROUPING SETS enables aggregated groups on several different sets of grouping columns within the same query.
This is especially useful when you want to return only a portion of an aggregated result set. GROUPING SETS also
lets you select which grouping columns to compare.
The GROUPING SETS operator is best explained by example. Consider the following clauses and the result sets
they return:
The GROUP BY GROUPING SETS clause lets you aggregate on more than one group in a single query. For each
group set, the query returns subtotals with the grouping column marked as NULL. If you’ve ever used the CUBE and
ROLLUP operators, you know they place predefined subtotals into the result set; the GROUPING SETS operator, on
the other hand, allows you to control what subtotals to add to the query. The GROUPING SETS operator does not
return a grand total.
Here’s a query where we chose to subtotal sales data by year and quarter and separately by year:
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 5
Another way to think of GROUPING SETS is to consider it to be like a UNION ALL of more than one GROUP BY
query that references different parts of the same data. You can tell the database to add subtotals to a grouping set by
simply adding in the ROLLUP or CUBE clause according to how you would like subtotaling to occur.
GROUPING SETS can also be concatenated to concisely generate large combinations of groupings. Concatenated
GROUPING SETS yield the cross-product of groupings from each of the sets within a GROUPING SET list.
Concatenated GROUPING SETS are compatible with CUBE and ROLLUP. Concatenated GROUPING SETS, since
they perform a cross-product of all GROUPING SETS, will generate a very large number of final groupings from even
a small number of concatenated groupings. For example, if we extend the earlier table to include concatenated
GROUPING SETS, we get the following:
… …
Note that the concatenated GROUPING SETS operator yields a large number of final groupings. You can image how
large the result set would be if the concatenated GROUPING SETS contained a large number of groupings!
However, the information returned can be very valuable and hard to reproduce without using a stored procedure or
other procedural code.
MERGE Statement
The MERGE statement is sometimes called “UPSERT” because it combines the action of multiple DML statements: if
the data doesn’t exist, then INSERT; if the data does exist, then UPDATE. Because the MERGE statement can
combine multiple actions into a single block of IO, you can avoid lots of IO especially in data warehousing situations
where lots of data manipulation occurs.
When writing a MERGE statement, you specify the source record set using a SELECT statement and identify the
type of data manipulation that will occur by pointing to a specific target table. For example, suppose that we have a
nightly process that moves old sales order details from the order_details table into the order_archives table.
Therefore, we want to insert any new order_detail records we encounter, and update any existing records with new
values if they have changed. With the MERGE statement, you can accomplish this with a single statement rather than
with many DML statements, as follows:
MERGE Order_Archive AS OA
USING
(SELECT order_ID, -- The initial query to find records
load_date = MIN(CONVERT(VARCHAR(8), GETDATE(), 112)),
order_total = SUM(order_amount),
order_count = COUNT(*)
FROM order_details
WHERE order_year <= 2008
GROUP BY order_ID)
AS archive_cte (order_ID, load_date, order_total, order_count)
ON (oa.CustomerID = archive_cte.CustomerID
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 6
AND oa.SalesDate = archive_cte.LoadDate)
Notice that the MERGE statement is broken in to three relatively simple sections:
• The clause MERGE table_name specifies the table whose data will be manipulated (the “target” table)
• The USING clause specifies the table where the data comes from (the “source” table)
• The ON clause specifies the join conditions between the source and target tables
The WHEN NOT MATCHED clause tells SQL Server the action to perform when no matching record is found in the
target table (insert a new record), and the WHEN MATCHED clause specifies what to do if a match is found (update
existing values in the order_archive table). Note that I could have told SQL Server to DELETE the record instead of
updating the values in the record.
As you can tell, this operation can save SQL Server many trips back and forth to cache (or even to disk if the
operation is very large) compared to a stored procedure or Transact-SQL batch that performs each separate DML
statement serially. This can be especially valuable for data warehouse ETL operations involving millions of records.
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 7
9. Developer Improvements
It’s no secret that good developers are always trying to crank out useful code more quickly, whether by making
procedural changes to the development cycle, by adopting techniques like SCRUM and Agile, or by coding in more
powerful and flexible languages.
However, for many developers the database server represents a sort of intellectual 'firewall' (not in the computer
security sense, but in the fire-fighting sense) that is hard to break through. That’s because in most IT environments,
no matter how good you are at a .NET language like C# or VB.Net, you still have to code in SQL and Transact-SQL.
(The Common Language Runtime, which can alleviate the need to code exclusively in Transact-SQL, is not
universally adopted in the marketplace.) Well, what if Microsoft could make that coding easier and faster for you?
Microsoft intends to do just that with a couple of new features: Language Integrated Query (LINQ) and table-valued
parameters (TVPs). Note that these features might be more tightly associated with Visual Studio 2008, but they are
best exploited against SQL Server 2008. Let’s talk about them in more detail.
For example, here are two versions of a standard type-safe LINQ to SQL VB query that retrieves data from a Sales
database. The first displays the query in an ASP.NET GridView control:
GridView1.DataSource = query
GridView1.DataBind()
The second does something similar using the LINQ DynamicQuery library:
GridView1.DataSource = query
GridView1.DataBind()
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 8
Table-Valued Parameters (TVPs)
While I’m not sure how widely LINQ will be used after the release of SQL Server 2008, I’m quite sure that table-
valued parameters will be widely and happily implemented by developers everywhere. Why? Simply that it is one of
the most widely requested features by among those tracked by Microsoft.
Table-valued parameters, something very much like an array, solve many challenges for developers, including
the following:
• Cleanly encapsulating tabular data that will be exchanged by the client application and the server
• Using scalar parameters as an array in the code and repeatedly acting upon that data as a “row”
TVPs not only solve problems like these, but they also make maintaining code much easier because you can much
more easily add new “columns” to the logical “table” created by the TVP. Here’s what a simple TVP looks like using
Transact-SQL:
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 9
8. Reporting Services (RS)
Improvements
SQL Server Reporting Services, which was one of the celebrity features of the later service packs of SQL Server 2000,
has grown more mature with each release of the database platform. Its widespread popularity is attributable to its stellar
performance and features coupled with zero cost (beyond the license cost for SQL Server).
Reporting Improvements
RS also has new features that make it useful in more situations and that increase its flexibility and availability to users:
• Ad-hoc reporting: Users who are not hard-core developers can quickly and easily build ad-hoc reports of
almost any structure and design through the new Report Designer interface
• Embedded reports: Users are now able to directly embed their reports into Web portals, dashboards, and
business applications. New rendering capabilities allow users to consume reports directly within Microsoft
Office Word, as they already could do with Excel. Additional deep integration with Microsoft Office
Sharepoint Server 2007 enables organizations to deliver reports to a central Web library or to render reports
directly within a Sharepoint dashboard. Sharepoint integrated mode provides integrated shared storage,
security, and document access accountability
• Subscription-based deployment: RS allows reports to be deployed via both standardized subscriptions
(such as automatic delivery via e-mail to a group of users at a predefined time) and data-driven
subscriptions, which retrieve subscription properties at run time so multiple users to get the same report, but
tailored with the parameters and formatting required by each individual user
Performance Improvements
In addition, a variety of performance improvements have greatly improved the power and enterprise-readiness of
SQL Server Reporting Services 2008. For example, you can now directly control server behavior with memory
management, simplified configuration, on-demand processing, and instance-based rendering. Other significant
improvements include:
• Caching: Reports can now be cached so that frequently accessed reports that use the same parameter
values are available much more quickly. Once a report is processed, a copy is cached so that users who
later request the same report can simply view the cached copy; the report is not processed again
• Snapshots: You can also request snapshots of a report: the report is processed on a schedule and made
available for users to view, much like a cached report except that the snapshot is created on schedule, before
any user requests it. This feature is especially useful for very complex or time-consuming rendering jobs
I’ve only touched on the high points of the new performance features in Reporting Services. However, one of the
things that I like the most about the improvements in RS is that they simply work. You don’t have to go in and recode
your applications or make difficult changes to your configurations. A simple in-place upgrade will yield immediate and
noticeable improvement in the performance of your reports.
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 10
7. Compression
There is an unmistakable trend in the industry for databases to get larger and larger. Companies not only record
more information than ever before; they also retain backups longer—sometimes many years longer than they used
to. Some progressive organizations are even thinking creatively about how to keep all data online, and seldom if ever
taking the data offline for archiving. (That doesn’t mean they’re not taking backups. I only mean to say that some
organizations keep their data live and in use in perpetuity, even while backing it up for safekeeping.)
Microsoft has introduced two new features with SQL Server 2008 that will help organizations more effectively drive
their practice of recording more data and keeping it on hand longer: data compression and backup compression.
Data Compression
Data compression enables you to store more data using less disk space. Moreover, data compression improves
performance for large I/O-bound workloads like data warehousing, because fewer disk reads and writes are needed
when data is compressed. This feature will have a performance impact, so it should be used in selective opportunities
like a read-only database.
Data compression works via two strategies: ROW compression and PAGE compression:
• ROW compression occurs when SQL Server uses a technique called variable-length storage formatting to
reduce the amount of space consumed by the column values in a row of data
• PAGE compression works by storing commonly duplicated row values once on the page and then creating
pointers the original value from the multiple columns
You use simple DDL commands to enable data compression, as shown the following example:
Backup Compression
Backups can take up a lot of space, especially if you need to keep several on hand for a large database. Moreover,
processing a large backup or restore can take a long time. There are many sophisticated third-party backup and
recovery products available in the market today, but with the Enterprise Edition of SQL Server 2008, backups can be
compressed, so less space is consumed on the disk. Interestingly, Microsoft has decided to implement this
compression in-process. Of course, the trade-off is that more CPU is consumed during the backups and restores
because the CPU must handle the compression algorithms, but the savings in time and disk space can be
considerable.
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 11
6. Data Types and Data Storage
Data Types
More and better data type inclusion is always a good feature for a database platform. New data types can offer more
logical storage for database designers as well help applications better serve their business owners. SQL Server 2008
includes a number of new data types; some (such as DATE and TIME) have been a part of the ANSI SQL standard
for a long time, but are only now making their way into SQL Server. Other data types are new to the industry overall
and might not even have been seen as feasible for a relational database ten years ago; these include FILESTREAM
and the spatial data types.
• Date and time: SQL Server 2008 introduces several new date and time data types that separate date and
time types while providing larger data ranges or user-defined precision for the time values:
• DATE stores only the date
• TIME stores only the time
• DATETIMEOFFSET stores datetime, but is time zone aware
• DATETIME2 is similar to the pre-existing DATETIME data type, but with larger fractional second
precision and year ranges that exceed that of DATETIME
• FILESTREAM: The FILESTREAM data type stores very large binary data directly on an NTFS file system,
while preserving database control and transactional consistency. For example, FILESTREAM would be just
the data type to choose if you wanted to use a database to control a library of video files
• Spatial data types: Spatial data types enable your application to be aware of locations within space. The
GEOGRAPHY data type uses latitude and longitude coordinates to implement round earth applications of
the Earth’s surface, while the GEOMETRY data type implements flat earth solutions, such as those
associated with interior spaces and the planar surfaces that might go into an interior space. Spatial data
types make it easy for application designers to integrate SQL Server applications with a GPS or mapping
application, among many other examples
• HIERARCHYID: Depicting tree structures in a relational database has always been notoriously difficult. SQL
Server 2008’s new HIERARCHYID enables database applications to model tree structures more efficiently
than ever before. Note that HIERARCHYID is a new system type implemented by a CLR UDT, rather than a
data type. HIERARCHYID store values that represent nodes of a hierarchy tree structure and includes some
useful built-in methods for managing hierarchy nodes
Some of the methods exposed by the UDT include:
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 12
Data Storage
In addition to the data type additions, SQL Server 2008 includes some nice new capabilities around how it stores
data. For example, in earlier versions, Full Text Search catalogs were external to the SQL Server database; SQL
Server 2008’s integrated Full Text Search makes search for text and relational data easy and seamless.
SQL Server 2008 has also improved the implementation of sparse columns (a sparse column is one that frequently
stores a great deal of NULL values). In earlier versions of SQL Server, NULL data consumed space. Now, sparse
columns consume no physical space and provide a highly efficient way to manage frequently empty columns in a table.
Finally, SQL Server 2008 eliminates the 8KB size limit for User-Defined Types (UDTs). Because UDTs can be
dramatically enlarged, their flexibility and power are similarly increased.
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 13
5. Security
A lot of people don’t realize how secure SQL Server has become in the years following the SQL Slammer internet
worm. Since then SQL Server has had only five critical security fixes—Oracle had over 100 in the same time period.
That’s rather reassuring for me. SQL Server 2008 continues this long run of excruciating attention to security with
support for transparent data encryption and extensible key management.
While SQL Server 2005 offered column-level and cell-level encryption, SQL Server 2008 offers the complementary
feature of encrypting an entire database. The syntax is very easy:
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 14
4. Resource Governor
The resource governor is a feature of SQL Server 2008 that many DBAs have coveted for years. With the resource
governor, you can specify the resource limits and priorities of the different workloads running on your SQL Server,
thereby enabling concurrent workloads to use a consistent amount of system resources and, by extension, provide a
consistent and predictable response to end users. And may I say just for the record that this is a really cool feature.
(You can get the complete lowdown on the resource governor in the TechNet article Introducing Resource Governor
at http://technet.microsoft.com/en-us/library/bb895232(SQL.100).aspx).
The resource governor works by allocating resources to various working pools or groups. There is always a default
resource pool. If there are no other workload groups defined for the SQL Server, then all activities both of users and
internal process run within the context of the default resource pool. Separate from, but often synonymous with the
default group, is the internal group. The internal group includes activities like the lazy writer, ghost record cleanup,
and certain trace activities.
A bit of terminology is due. An instance can have one or more resource pools (but no more than 20). Beneath the
resource pools, you can create one or more groups. There’s no physical limit on the number of groups you can
create, but I encourage a conservative approach. A group must be assigned to a single resource pool, but resource
pools can have one or more groups.
You might create a workload group for quality assurance that looks like this:
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 15
This function then needs to be applied to the resource governor like this:
The next step is to configure which system resources are assigned to each of the workload groups:
You must finally apply the changes to the resource governor process, which is active and running in memory:
Note that you should be cautious when altering the resource governor because changes will take effect immediately.
You can later change process to run with different resources at any time, immediately affecting all processes already
running. However, once a session is bound to a group or pool, it remains bound until it is disconnected.
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 16
3. Auditing and Change Tracking
Several important new U.S. laws have a direct impact on how organizations store data and audit the activity against
that data. In particular, medical companies must comply with HIPAA and be able to prove their compliance to external
auditors. Similarly, publicly traded companies must comply with Sarbanes-Oxley (SOX). SQL Server 2008 provides
features that make compliance, data access control, and change tracking much easier.
Audit Object
SQL Server 2008 supports the Audit object, which enables you to capture database activity and store it in a log file or
Windows application or security logs. To enable auditing on your SQL Server, you must use the CREATE SERVER
AUDIT syntax, which configures the Audit object and determines where its auditing data is written, as shown in the
following example:
If you specify that the audit data should be written to a file, you do not need to provide a name; SQL Server will
provide one for you in the format audit-name_audit-guid_nn_tstamp.sqlaudit, where audit-name is the name chosen
in the CREATE SERVER AUDIT statement, audit-guid is a unique identifier for the Audit object, nn is the partition
number used to partition file sets, and tstamp is a timestamp value.
Once the server audit is created, you can add more database-level events to audit using the CREATE DATABASE
AUDIT SPECIFICATION statement. For example, the following statement causes the audit we created earlier to
record whenever a failed login attempt occurs:
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 17
DDL Triggers
DDL triggers first appeared in SQL Server 2005 and are in many ways similar to a regular INSERT, UPDATE, or
DELETE trigger. The primary difference is that the DDL triggers fire after a triggering event such as an ALTER USER
statement or a DROP TABLE statement at the database level, or ALTER DATABASE or CREATE LOGIN at the
server level. Think of DDL triggers as triggers for the CREATE, ALTER, and DROP statements. SQL Server provides
a shorthand with groups. Thus, you could write one trigger for DDL_TABLE_EVENTS to handle CREATE_TABLE,
ALTER_TABLE, and DROP TABLE statements. For full details, refer to SQL Server 2008 Books Online at
http://msdn2.microsoft.com/en-us/library/bb543165(sql.100).aspx.
You can use DDL triggers to prevent certain DDL operations from occurring, or to restrict the activities of particular
users. But you can also use this feature to capture and audit DDL activity within a database by writing data to an audit
table in the database or server, or to an audit file on the file system.
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 18
2. Analysis Services (AS) Performance
Improvements
SQL Server 2008 Analysis Services have gotten a lot faster, so if you are one of the many users who make heavy
use of Analysis Services, you’re going to be very happy with SQL Server 2008. The following are a few of the
features that improve the performance of Analysis Services:
• Block computations: Block computations provide big performance gains by eliminating unnecessary
aggregation calculations, such as NULL values in an aggregation. (It’s called “block mode” because it
evaluates data by blocks rather than the previous “cell-by-cell mode” of early versions of AS.) Some
bloggers have reported anecdotal testing results that show calculations being 50-60% faster than the same
calculations on SQL Server 2005. Cube calculation times are likewise much faster, so users can increase
the depth of their hierarchies, perform more complex calculations, or simply accomplish the same work as
before more quickly.
Since block mode computations are driven by proper MDX code, see the full list of MDC commands that
work with or invalid block computations in the white paper Performance Improvements for MDX in AS 2008,
available at http://msdn2.microsoft.com/en-us/library/bb934106(SQL.100).aspx.
• Writeback: Writeback is the ability to change the structure of a dimension even as you analyze it. Efficient
writeback is critical to high-performance what-if scenario modeling. SQL Server 2008 includes a new
MOLAP-enabled writeback feature that removes the need to query ROLAP partitions. The new writeback
technique means that fewer round trips are needed between the client and the OLAP partition to complete
the analytical modeling. That is, writeback occurs faster in SQL Server 2008, so that when changes are
made to a model, they are then written back to the database, which in turn refreshes the cube in a more
timely manner. Users get better and faster writeback scenarios without giving up any of the advantages of a
traditional OLAP engine for aggregating data.
Note that writeback has been in SQL Server Analysis Services for a while, but the improvements in SQL
Server 2008 are drastic enough that you will not be able to use writebacks created using earlier versions of
SQL Server with the 2008 release; you’ll need to recreate all of your writebacks when you upgrade.
• Star join query optimizations: By default, the SQL Server query engine is very efficient at choosing a
query plan, even when dealing with millions of rows of data for a single query. One technique SQL Server
uses to improve star schema joins is through a bitmap filter, a miniature model of a set of values from a table
in one part of the operator tree to filter rows out of a second table in another part of the tree. By making sure
to join only to qualified records in the second table when analyzing records in the first table, the bitmap filter
significantly reduces the amount of data that needs to be processed. SQL Server 2005 allowed the use of
bitmap filtering after optimization, but SQL Server 2008 also allows a bitmap filter to be dynamically applied
during query plan generation. When the bitmap filter is applied, non-qualifying rows in the fact table are
immediately eliminated, so the query is enormously faster. Read more about the intricacies of this new
feature in the TechNet article Optimizing Data Warehouse Query Performance Through Bitmap Filtering at
http://technet.microsoft.com/en-us/library/bb522541(SQL.100).aspx.
Other improvements to SQL Server 2008 Analysis Services provide enhanced analytical capabilities and
support more complex computations and aggregations. And less prominent features offer useful incremental
improvements in the overall performance of Analysis Services. Without a doubt, SQL Server 2008 Analysis
Services will be the fastest and most powerful release yet.
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 19
1. Multi-Server Management
Multi-server management is a topic near and dear to my heart because I struggled mightily with it for many years of
my career. And I see a strong trend for DBAs and developers to be able to deploy large numbers of SQL servers
throughout their IT environments and then to adequately support and maintain them. On the one hand, many shops
still work under the policy of “one application, one server,” which results in rampant and sometimes entirely
unnecessary server proliferation. On the other hand, even in shops where server proliferation is tightly controlled, the
enterprise often simply needs a lot of SQL servers but cannot afford a lot of DBAs to maintain them. Consequently,
most enterprise SQL Server DBAs have to support a LOT of SQL servers in their shops.
With previous versions of SQL Server, I (and others like me) would automate as much work as possible through clever
use of SQL Server Agent jobs and scripts. For example, one DBA I know gets new servers to administer so frequently
that he can’t keep up with getting them on backup rotations. So he built a script and a job to look for new servers in his
shop and put all of the databases on any new server onto a backup schedule. SQL Server 2008 makes managing
multiple servers much easier, in part through two improvements, streamlined installation and Policy-based Management.
Streamlined Installation
Microsoft completely overhauled the process of installation, setup, and configuration of SQL Server. Whereas earlier
versions forced you to perform all three activities at once, SQL Server 2008 separates the installation of the physical
bits on the hardware from the configuration of SQL Server. This means that a centralized IT group or a third-party
provider can give sites a recommended installation configuration (contained in a file) without also having to install
SQL Server. Once a local administrator is able to install SQL Server, the configuration file tells SQL Server how to set
up and configure itself without user intervention.
PBM is a policy-based system for managing one or more instances of SQL Server 2008. This is a very important shift
because most DBAs organize their work around tasks, such as creating backups or performing consistency checks,
not policies. PBM enables you to implement a “monitor by exceptions” style of working in which you need to get
involved only when an exception to the rules of good operations occurs. For example, you can use PBM to create
policies that manage entities on the server (such as the instance of SQL Server, databases, and other SQL Server
objects), as well as the things you want to restrict (such as failed logins), the things you’d like to enforce (like naming
standards), and the things you’d like to monitor (like blocked processes). And you can even scope your policies to
both the entire server and a specific database. Wow!
PBM also allows some really neat automation. Anyone in the PolicyAdministratorRole can create and apply policies.
Under PBM, you can run policies on demand or use one of these automated execution modes:
• Changes are attempted and, when out of compliance, are prevented. PBM uses DDL triggers to prevent
policy violations
• Changes are attempted and, when out of compliance, are allowed but logged. PBM uses event
notification to evaluate a policy when a relevant change occurs
• On schedule, log out-of-compliance. PBM uses a SQL Server Agent job to periodically evaluate a policy
on all the servers where it’s applied
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 20
You can create a policy using Management Studio. Once you’ve created a policy, you can export it to an XML file and
then import it, individually or by group, into other SQL Servers.
• Impose the surface area configuration settings of one instance onto another
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 21
Conclusion
SQL Server 2008 has so many new features and capabilities that I can’t possibly list them all here. Instead, explained
in detail the features that I’m most excited about. Take the time to get to know why these features are so useful and
then explore on your own. You may find other new features in SQL Server 2008 that are even more exciting for your
particular situations.
10. The SQL improvements offered by GROUPING SETS and the MERGE statement
9. The developer-centric improvements of LINQ and table-valued parameters
8. Reporting Services improvements: dropping the requirement for IIS; powerful new features for ad-hoc
reporting, embedded reports, and subscription-based deployment; and performance improvements like
improved caching and snapshot reports
7. The data and backup compression features in SQL Server 2008 Enterprise Edition
6. The new spatial, FILESTREAM, HIERARCHYID, and date and time data types
5. The security improvements of transparent data encryption and extensible key management
4. The oh-so-sweet resource governor
3. The audit and change tracking abilities of audit objects and DDL triggers
2. The big gains in Analysis Services performance with things like block computations and writeback
improvements
1. The multi-server management capabilities of Policy-based Management and streamlined installation.
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 22
About the Author
Kevin Kline is the technical strategy manager for SQL Server Solutions at Quest Software. A Microsoft SQL Server
MVP since 2004, Kevin is a founding board member and past president of the Professional Association for SQL
Server (PASS), a worldwide industry organization. He has written or co-written several books, including "SQL in a
Nutshell" (O’Reilly & Associates), "Pro SQL Server 2008 Relational Database Design and Implementation"
(www.apress.com/book/view/143020866x), and "Database Benchmarking: Practical Methods for Oracle & SQL
Server" (Rampant). Kevin regularly contributes to SQL Server Magazine and Database Trends & Applications, as well
as blogs at SQLBlog.com and SQLMag.com. He is a top-rated speaker at such worldwide conferences as Microsoft
Tech.Ed; the PASS Community Summit; Microsoft IT Forum; DevTeach; and SQL Connections. Kevin has been
active in the IT industry since 1986.
White Paper - Worth the Wait: Top 10 Reasons Why SQL Server 2008 is Great 23
WHITE PAPER
E-MAIL sales@quest.com
Quest Support provides around-the-clock coverage with SupportLink, our Web self-service.
Visit SupportLink at https://support.quest.com.
• Download the latest releases, documentation, and patches for Quest products
View the Global Support Guide for a detailed explanation of support programs, online services,
contact information, and policies and procedures.
5 Polaris Way, Aliso Viejo, CA 92656 | PHONE 800.306.9329 | WEB www.quest.com | E-MAIL sales@quest.com
If you are located outside North America, you can find your local office information on our Web site.
Quest Software is registered trademark of Quest Software, Inc. in the U.S.A. and/or other countries. All other trademarks and registered trademarks are property of their respective owners.
WPD-WorthTheWait-US-AG-20100421