SQL Server 2008 R2 SP1 for Developers

Preview:

DESCRIPTION

deck from my talk for TechEd Africa Oct 2011

Citation preview

17-20 OCTOBER 2011

DURBAN ICC

SQL Server 2008 R2 for Developers@LynnLangit & @LlewellynFalco

SESSION CODE: DAT312

SQL Server 2008 R2 – So Many Features…

• Lifecycle Management– DACPACs (Data Tier Applications)

• T-SQL enhancements– Geospatial data types– XML data enhancements– Filestreams (BLOBS)– Sparse Columns– Filtered indices and full-text search

• Programmability– Entity Framework

For Developers & DBAs

Data Tier Applications (DAC)

• A single container for management for scripts++• Simplifies Development & Deployment• Has Version number for each container• Includes Policies (deployment prerequisites)

• From SSMS, VS2010 and more• For SQL Server, SQL Azure

Data-tier Application Lifecycle

• CREATE TABLE Orders• (• id INT,• ordTime DATETIME,• .• .• .

• ) -- ON OrdPS(ordTime)

• CREATE TABLE OrderEntr• (

• CREATE TABLE Orders

• (• id

INT,• ordTime

DATETIME,• .• .• .

• ) -- ON OrdPS(ordTime)

• CREATE TABLE OrderEntr

DevelopSource code

Contained database

DefinitionDeployment

artifact

RuntimeContainer

DACPAC

Build

ReverseEngineer Extract

Deploy

Upgrade

DACFx Services

DACPAC

DACPAC in SSMS 2010

Upgrading with DACPAC

Monitoring DACPACs via UCPs

DACPAC project in Visual Studio 2010

Creating DACPAC

(c) 2011 Microsoft. All rights reserved.

Import schema from – script, database or DACPAC

DACPAC Project Template• Schema objects

• Ordered by Schema• Also Database Level Objects

• Scripts• Post-Deployment• Pre-Deployment

• Data Generation Plans• Schema Comparisons

Schema Comparison

(c) 2011 Microsoft. All rights reserved.

Data Generation in DACPACs

(c) 2011 Microsoft. All rights reserved.

Build…Deploy

(c) 2011 Microsoft. All rights reserved.

Smarter T-SQL“Smart T-SQL”

Geospatial types

XML or Filestream

Full-text

Sparse Columns

T-SQL Enhancements• MERGE

- Less scans through table & more query flexibility

• GROUPING SETS - Less scans through table & more query flexibility

• Table-valued strongly-typed parameters- Less round trips to database

Better T-SQL

More T-SQL Enhancements• Sparse Column enhancements• XML enhancements• Geospatial enhancements• Filestream enhancements• Full-text enhancements

Better Data types

Entity Framework• What is EF?

– Object/Relational Mapping (ORM) framework

• How to use EF– query using LINQ– retrieve & manipulate data as strongly typed objects– LINQ to Entities provides IntelliSense

• Why use EF?– work with relational data as domain-specific objects – eliminates the need for most of the data access plumbing code that you

previously wrote

EF Stack & Development Process Types

(c) 2011 Microsoft. All rights reserved.

• Database first• Model first• Code first (new in 4.1)

Entity Framework

EF Templates

EF Power Tools

(c) 2011 Microsoft. All rights reserved.

POCO Classes - I

(c) 2011 Microsoft. All rights reserved.

POCO Classes - II

(c) 2011 Microsoft. All rights reserved.

Overriding Default Configuration

(c) 2011 Microsoft. All rights reserved.

Using EF with MVC

(c) 2011 Microsoft. All rights reserved.

EF 4.2

(c) 2011 Microsoft. All rights reserved.

templates for using DbContext with Database First or Model First are now available on Visual Studio Gallery

Code to expose WCF service from EF

Sample code to access EF data

Entity Framework Profiling• Visual Studio Ultimate

• Intellitrace• VS Profiler - article here

• SQL Server Profiler• 3rd party tools • Article on Tracing - here

You can use raw T-SQL

New in SP1•New or Improved Dynamic Management Views

--sys.dm_exec_query_stats --additional columns (long-running queries)--new DMVs and XEvents on select performance counters are introduced to monitor OS configurations/resource conditions related to the SQL Server instance

•Improved FORCESEEK index hint & New FORCESCAN query hint --syntax modified w/optional parameters allowing it to control the access method on the index even further--FORCESCAN complements the FORCESEEK hint allowing specifying ‘scan’ as the access method to the index

•Improved DACPAC - (DAC Fx) improved database upgrades: --(DAC) Framework v1.1 and DAC upgrade wizard enable the new in-place upgrade service --New in-place upgrade service will upgrade the schema for an existing database in SQL Azure and the versions of SQL Server supported by DAC

•New Disk space control for PowerPivot: --Introduces two new configuration settings --lets you determine how long cached data stays in the system

SQL Server 2008 R2 – So Many Features…

• Lifecycle Management– DACPACs (Data Tier Applications)

• T-SQL enhancements– Geospatial data types– XML data enhancements– Filestreams (BLOBS)– Sparse Columns– Filtered indices and full-text search

• Programmability– Entity Framework

For Developers & DBAs

Team Content – SQL Server• SQL CAT (Dev) blog - here• SQL Programmability blog - here• SQL Query Processing blog – here• MSDN Webcast: New T-SQL Programmability

Features in SQL Server 2008 (Event ID: 1032357753)

Resources

• SQL Server (Dev, BI)• SQL Azure• Intro To TDD • Legacy Code

www.Develop.com

TeachingKidsProgramming.orgDo a Recipe Teach a Kid (Ages 10 ++)Microsoft SmallBasic Free Courseware (recipes)

Contact Information@LlewellynFalcohttp://LlewellynFalco.Blogspot.comhttp://www.approvaltests.com

@LynnLangithttp://www.LynnLangit.com

Submit your session evaluation for a chance to win!

Sponsored by MVA

http://microsoftvirtualacademy.com

Creating

the futuretogether

Recommended