What’s New in SQL Server 2005 From a Developer’s Perspective.

12
What’s New in SQL Server 2005 From a Developer’s From a Developer’s Perspective Perspective

Transcript of What’s New in SQL Server 2005 From a Developer’s Perspective.

Page 1: What’s New in SQL Server 2005 From a Developer’s Perspective.

What’s New in SQL Server 2005What’s New in

SQL Server 2005

From a Developer’s PerspectiveFrom a Developer’s Perspective

Page 2: What’s New in SQL Server 2005 From a Developer’s Perspective.

SQL Server 2005 VersionsSQL Server 2005 VersionsEnterprise EditionEnterprise Edition

Standard EditionStandard Edition

Workgroup EditionWorkgroup Edition

Developer EditionDeveloper Edition

Express EditionExpress Edition

Mobile EditionMobile Edition

Everywhere Edition (CTP)Everywhere Edition (CTP)

ALSO AVAILABLE:ALSO AVAILABLE:

SQL Server 2005 Service Pack 1SQL Server 2005 Service Pack 1SQL Server 2005 Feature PackSQL Server 2005 Feature Pack

Page 3: What’s New in SQL Server 2005 From a Developer’s Perspective.

What’s new in SQL Server What’s new in SQL Server 20052005Database EngineDatabase Engine

Service BrokerService BrokerHTTP AccessHTTP AccessDatabase Tuning Advisor Database Tuning Advisor Enhanced Read ahead & scanEnhanced Read ahead & scanIndexesIndexes with Included Columnswith Included ColumnsMultiple Active Result Sets Multiple Active Result Sets Persisted Computed ColumnsPersisted Computed ColumnsTry/Catch in T-SQL statementsTry/Catch in T-SQL statementsCommon Table ExpressionsCommon Table ExpressionsServer EventsServer EventsSnapshot Isolation Level Snapshot Isolation Level PartitioningPartitioningSynonymsSynonymsDynamic Management ViewsDynamic Management Views

.NET Framework.NET FrameworkCommon Language Runtime IntegrationCommon Language Runtime IntegrationCLR-basedCLR-based Types, Functions, & TriggersFunctions, & TriggersSQL Server .NET Data ProviderSQL Server .NET Data Provider

Data TypesData TypesCLR-based Data TypesCLR-based Data TypesVARCHAR(MAX), VARBINARY(MAX)VARCHAR(MAX), VARBINARY(MAX)XML DatatypeXML Datatype

Database Failure and RedundancyDatabase Failure and RedundancyFail-over Clustering (up to 8 node)Fail-over Clustering (up to 8 node)Database MirroringDatabase MirroringDatabase SnapshotsDatabase SnapshotsEnhanced Multi-instance SupportEnhanced Multi-instance Support

XMLXMLNew XML data typeNew XML data typeXML IndexesXML IndexesXQUERY SupportXQUERY SupportXML Schema (XSD) supportXML Schema (XSD) supportFOR XML PATHFOR XML PATHXML Data Manipulation Language XML Data Manipulation Language SQLXML 4.0SQLXML 4.0

Database MaintenanceDatabase MaintenanceBackup and Restore EnhancementsBackup and Restore EnhancementsChecksum Integrity ChecksChecksum Integrity ChecksDedicated Administrator ConnectionDedicated Administrator ConnectionDynamic Configuration AWEDynamic Configuration AWEHighly-available UpgradeHighly-available UpgradeOnline Index OperationsOnline Index OperationsOnline RestoreOnline Restore

Management ToolsManagement ToolsMDX & XML/A Query EditorMDX & XML/A Query EditorMaintenance Plan DesignerMaintenance Plan DesignerSource Control SupportSource Control SupportProfiler access to non-saProfiler access to non-saSQLCMD Command Line ToolSQLCMD Command Line ToolDatabase MailDatabase Mail

Performance TuningPerformance Tuning Profiling Analysis ServicesProfiling Analysis ServicesExportable Showplan & Deadlocks Exportable Showplan & Deadlocks Profiler EnhancementsProfiler EnhancementsNew Trace EventsNew Trace Events

Full-text SearchFull-text SearchBackup/Restore includes FT catalogsBackup/Restore includes FT catalogsMulti-instance serviceMulti-instance service

SQL Client .NET Data ProviderSQL Client .NET Data ProviderServer Cursor SupportServer Cursor SupportMultiple Active Result SetsMultiple Active Result Sets

SecuritySecurityCatalog and meta-data securityCatalog and meta-data securityPassword policy enforcementPassword policy enforcementFine Grain Administration RightsFine Grain Administration RightsSeparation of Users and SchemaSeparation of Users and SchemaSurface Area ConfigurationSurface Area Configuration

Notification ServicesNotification ServicesEmbed NS in existing applicationEmbed NS in existing applicationUser-defined match logicUser-defined match logicAnalysis Services Event ProviderAnalysis Services Event Provider

ReplicationReplicationSeamless DDL replicationSeamless DDL replicationMerge Web SyncMerge Web SyncOracle PublicationOracle PublicationPeer to Peer Transactional replicationPeer to Peer Transactional replicationMerge replication perf and scalabilityMerge replication perf and scalabilityNew monitor and improved UINew monitor and improved UI

Analysis Services and Data MiningAnalysis Services and Data MiningAnalysis Management Objects Analysis Management Objects Windows Integrated Backup and Windows Integrated Backup and

RestoreRestoreWeb Service/XML for AnalysisWeb Service/XML for AnalysisIntegration Services and DM Integration Services and DM

IntegrationIntegrationEight new Data Mining algorithmsEight new Data Mining algorithmsAuto Packaging and DeploymentAuto Packaging and DeploymentMigration WizardMigration Wizard

Integration ServicesIntegration ServicesNew high performance architectureNew high performance architectureVisual design and debugging Visual design and debugging

environmentenvironmentExtensible with custom code and Extensible with custom code and

scriptsscriptsXML task and data sourceXML task and data sourceSAP connectivitySAP connectivityIntegrated data cleansing & text Integrated data cleansing & text

miningminingSlowly changing dimension wizardSlowly changing dimension wizardImproved flow controlImproved flow controlIntegration with other BI productsIntegration with other BI products

Reporting ServicesReporting ServicesReport BuilderReport BuilderAnalysis Services Query DesignerAnalysis Services Query DesignerEnhanced Expression EditorEnhanced Expression EditorMulti-valued Parameters Multi-valued Parameters Date PickerDate PickerSharepoint Web PartsSharepoint Web PartsFloating HeadersFloating HeadersCustom Report ItemsCustom Report ItemsXML Data ProviderXML Data Provider

Page 4: What’s New in SQL Server 2005 From a Developer’s Perspective.

Database EngineDatabase Engine

Service BrokerService Broker

HTTP Access (web services)HTTP Access (web services)

Database Tuning AdvisorDatabase Tuning Advisor

Enhanced Read ahead & Enhanced Read ahead & scanscan

Indexes with Included Indexes with Included ColumnsColumns

Multiple Active Result Sets Multiple Active Result Sets

Persisted Computed Persisted Computed ColumnsColumns

Try/Catch in T-SQLTry/Catch in T-SQL

Server EventsServer Events

Snapshot Isolation LevelSnapshot Isolation Level

PartitioningPartitioning

SynonymsSynonyms

Dynamic Management Dynamic Management ViewsViews

Page 5: What’s New in SQL Server 2005 From a Developer’s Perspective.

T-SQL EnhancementsT-SQL Enhancements Varchar(max), Varbinary(max)Varchar(max), Varbinary(max)

In SQL 2000, fields over 8,000 In SQL 2000, fields over 8,000 characters used Text, Image but that characters used Text, Image but that involved a different programming style involved a different programming style than smaller fields.than smaller fields.

Now fields of type char, varchar, binary, Now fields of type char, varchar, binary, varbinary can hold up to 2 GB storage varbinary can hold up to 2 GB storage with same programming style as small with same programming style as small fields.fields.

Page 6: What’s New in SQL Server 2005 From a Developer’s Perspective.

T-SQL EnhancementsT-SQL Enhancements Exception HandlingException Handling

Try/Catch, similar to VB.Net error Try/Catch, similar to VB.Net error handlinghandling

BEGIN TRY DECLARE @X INT -- Divide by zero to generate Error SET @X = 1/0

PRINT 'Command after error in TRY'END TRYBEGIN CATCH

PRINT 'Error Detected'END CATCHPRINT 'Command after TRY/CATCH blocks'

Page 7: What’s New in SQL Server 2005 From a Developer’s Perspective.

T-SQL EnhancementsT-SQL Enhancements New Functions in CATCH blockNew Functions in CATCH block

ERROR_NUMBER(): Returns a number associated with the ERROR_NUMBER(): Returns a number associated with the error.error.

ERROR_SEVERITY(): Returns the severity of the error.ERROR_SEVERITY(): Returns the severity of the error. ERROR_STATE(): Returns the error state numberERROR_STATE(): Returns the error state number

ERROR_PROCEDURE(): Returns the name of the stored ERROR_PROCEDURE(): Returns the name of the stored procedure or trigger in which the error occurred.procedure or trigger in which the error occurred.

ERROR_LINE(): Returns the line number inside the failing ERROR_LINE(): Returns the line number inside the failing routine that caused the error. routine that caused the error.

ERROR_MESSAGE(): Returns the complete text of the error ERROR_MESSAGE(): Returns the complete text of the error message. The text includes the values supplied for any message. The text includes the values supplied for any substitutable parameters, such as lengths, object names, or substitutable parameters, such as lengths, object names, or times.times.

Page 8: What’s New in SQL Server 2005 From a Developer’s Perspective.

T-SQL EnhancementsT-SQL EnhancementsSome Errors Are Not Trapped Some Errors Are Not Trapped

Compile errors, like a syntax errorCompile errors, like a syntax error

Deferred name resolution errors created Deferred name resolution errors created by statement level recompilations.by statement level recompilations.

If a process is terminated by a KILL If a process is terminated by a KILL commandcommand

Client interrupt requests or broken client Client interrupt requests or broken client connections connections

Control passes back to the application Control passes back to the application immediately for errors that are not immediately for errors that are not trappedtrapped

Page 9: What’s New in SQL Server 2005 From a Developer’s Perspective.

T-SQL EnhancementsT-SQL Enhancements Common Table Expressions (CTEs)Common Table Expressions (CTEs)

Is a non-persistent table view of a query result setIs a non-persistent table view of a query result set

Can be defined one and used multiple times in query Can be defined one and used multiple times in query (can be used in FROM clause of subsequent step in db (can be used in FROM clause of subsequent step in db object)object)

Can use for INSERT, UPDATE, DELETE and CREATE VIEWCan use for INSERT, UPDATE, DELETE and CREATE VIEW

Provides capability for recursive queriesProvides capability for recursive queries

Page 10: What’s New in SQL Server 2005 From a Developer’s Perspective.

T-SQL EnhancementsT-SQL Enhancements

Multiple Active ResultSets Multiple Active ResultSets (MARS)(MARS)

SQL Server 2005 introduces the ability SQL Server 2005 introduces the ability for multiple statements to return result for multiple statements to return result sets (forward-only, read-only) at the sets (forward-only, read-only) at the same time on a single connection. same time on a single connection.

In earlier versions of SQL Server, only In earlier versions of SQL Server, only one statement at a time could actively one statement at a time could actively return result sets for each connection, return result sets for each connection, and no new statements could be and no new statements could be executed until all of the result sets were executed until all of the result sets were retrieved. retrieved.

(better support for connection pooling)(better support for connection pooling)

Page 11: What’s New in SQL Server 2005 From a Developer’s Perspective.

T-SQL EnhancementsT-SQL Enhancements PIVOT, UNPIVOT PIVOT, UNPIVOT (new)(new)

Can use in the FROM clause of a query. Can use in the FROM clause of a query. These operators perform some These operators perform some manipulation on an input table-valued manipulation on an input table-valued expression, and produce an output expression, and produce an output table as a result. table as a result.

The PIVOT operator rotates rows into The PIVOT operator rotates rows into columns, possibly performing columns, possibly performing aggregations along the way. It widens aggregations along the way. It widens the input table expression based on a the input table expression based on a given pivot column, generating an given pivot column, generating an output table with a column for each output table with a column for each unique value in the pivot column.unique value in the pivot column.

Page 12: What’s New in SQL Server 2005 From a Developer’s Perspective.

T-SQL EnhancementsT-SQL Enhancements

TOP (expression)TOP (expression)

The TOP operator has been The TOP operator has been enhanced to take any numeric enhanced to take any numeric expression (such as a variable expression (such as a variable name) instead of only an integer name) instead of only an integer number to specify the number of number to specify the number of rows returned by the operator.rows returned by the operator.

TOP can also now be specified in TOP can also now be specified in INSERT, UPDATE, and DELETE INSERT, UPDATE, and DELETE statements.statements.