SlideShare une entreprise Scribd logo
1  sur  195
Télécharger pour lire hors ligne
SQL Server Workshop
           for Developers
Andrew Brust                  Leonard Lobel
CEO and Founder         CTO, Sleek Technologies
Blue Badge Insights   Principal Consultant, Tallan

                                  Level: Intermediate

                                       May 14, 2012
Meet Andrew
 •   CEO and Founder, Blue Badge Insights
 •   CTO, Tallan, Inc.
 •   Member, Microsoft BI Partner Advisory Council
 •   Microsoft Regional Director, MVP
 •   Co-chair VSLive! and over 15 years as a speaker
 •   Founder, Microsoft BI User Group of NYC
     – http://www.msbinyc.com
 •   Co-moderator, NYC .NET Developers Group
     – http://www.nycdotnetdev.com
 •   “Redmond Review” columnist for
     Visual Studio Magazine and Redmond Developer News
 •   brustblog.com, Twitter: @andrewbrust
Andrew’s New Blog (bit.ly/bigondata)
Meet Lenni
  sleek          Leonard Lobel
  technologies   •   CTO & Co-Founder
                     – Sleek Technologies, Inc.
                 •   Principal Consultant
                     – Tallan, Inc.
                 •   Microsoft MVP
                     – SQL Server
                 •   .NET consultant and trainer
                 •   Speaker
                 •   Author
                 •   Programming since 1979

                 Contact
                 •   Email: lenni.lobel@sleektech.com
                 •   Blog: lennilobel.wordpress.com
                 •   Twitter: @lennilobel
Read All About It!
Agenda
 •   Part I
     – Overview
 •   Part II
     – T-SQL Enhancements
 •   Part III
     – Business Intelligence
 •   Part IV
     – Beyond Relational
 •   Demos, demos, demos!
     –http://sdrv.ms/VSLiveNY2012SQL
Download Slides and Code



    http://sdrv.ms/
    VSLiveNY2012SQL

        (case sensitive!)
PART I




  OVERVIEW
SQL Server Versions
•   SQL Server 2012 (Version 11)
    – Newest version of SQL Server
    – Released March 7, 2012
•   SQL Server 2008 R2 (Version 10.5)
    – Adds powerful BI features to SQL Server 2008
    – Released April 21, 2010
•   SQL Server 2008 (Version 10)
    – Released August 6, 2008
•   SQL Server 2005
    – Revolutionary upgrade from SQL Server 2000
    – Integration of multiple services (SSRS, SSAS, SSIS) with the RDBMS
•   Before SQL Server 2005…
    – The relational database engine was the product
    – Added value features (Reporting, OLAP, DTS) through a patchwork of
      optional add-ons
SQL Server Versions
•   SQL Server 2012 (Version 11)
    – Newest version of SQL Server
    – Released March 7, 2012
•   SQL Server 2008 R2 (Version 10.5)
    – Adds powerful BI features to SQL Server 2008
    – Released April 21, 2010
•   SQL Server 2008 (Version 10)
    – Released August 6, 2008
•   SQL Server 2005
    – Revolutionary upgrade from SQL Server 2000
    – Integration of multiple services (SSRS, SSAS, SSIS) with the RDBMS
•   Before SQL Server 2005…
    – The relational database engine was the product
    – Added value features (Reporting, OLAP, DTS) through a patchwork of
      optional add-ons
Introducing SQL Server 2012
•   The latest major release of SQL Server
•   Mission Critical Platform
    – HADR (High-Availability Disaster Recovery)
•   IT and Developer Productivity
    – SQL Server Data Tools (SSDT)
    – T-SQL enhancements
    – Beyond Relational enhancements (FileTable, FTS improvements)
    – Geospatial improvements (circular data, full globe, performance)
•   Pervasive Insight
    – Columnstore Indexing (xVelocity)
    – BI Semantic Model (PowerPivot technology) comes to Analysis
      Services
    – Real ad hoc reporting and data visualization in Power View
    – Data lineage and data quality (DQS)
BI Foundation

  •   Stack Review
      – The MS BI Stack
      – The SQL Server 2008 R2 “sub-stack”
      – New SQL Server 2012 Components
  •   Analysis Services and OLAP
      – Dimensional Concepts
      – Analysis Services cube design
      – Overview of ADO MD.NET and other APIs
BI Delivery

  •   Presentation Layer
      – Excel BI
      – PowerPivot and Excel Services
        Including new PowerPivot features in SQL Server 2012
      – Analysis Services tabular databases (SQL Server 2012)
      – Power View (SQL Server 2012)
      – Reporting Services and Report Builder
      – PerformancePoint Services (brief)
  •   Overview: Other New R2/2012 Components
      – Master Data Services, Data Quality Services
      – StreamInsight
Introducing SQL Server Data Tools
•   SSDT – Code-named “Juneau”
    – Next generation IDE for SQL Server development
    – Declarative, model-based development in connected, offline, and
      cloud scenarios
    – New project type: SQL Server Database Project
    – Visual Studio shell, solutions, projects + (partial) SSMS/Azure
      functionality + full BIDS
•   Not intended to replace SSMS
    – SSMS still the primary dba tool for managing SQL Server
•   Intended to replace VS DbPro (aka “data dude”)
    – But not ready to, as it still lacks total feature parity
    – Missing data generation, data compare, unit testing
•   Separate Web Platform Installer Download
    – Updates to ship out-of-band with VS and SQL Server releases
Declarative Model-Based Development
                     SQL Server Data Tools (SSDT)
                      Offline
                     Dev/Test
On-Premise                                                    Cloud
DataCenter                  Database Model

                      SQL Server Database Project



  SQL Server 2005,          Local Database
   2008, 2008 R2,              Runtime                           SQL Azure
       2012                   (LocalDB)




                           Database Snapshot File (.dacpac)

Version
History
SSDT Projects


                                         SSDT
 Relational                 Analysis                    Reporting           Integration
  Engine                    Services                     Services             Services


  SQL Server      Static Analysis        Database          T-SQL Language   Power Buffer
Object Explorer   and Validation          Publish             Services        Editing

                    Schema             Local Database          T-SQL
Table Designer                                                                SQL CLR
                    Compare               Runtime            Debugging
PART II




  T-SQL ENHANCEMENTS
TABLE-VALUED
PARAMETERS
Table-Valued Parameters

•   Process a set of rows as a single entity
    – Similar to temp tables, table variables and CTEs
    – Example: INSERT an entire order (header & details) with only two
      parameters and one stored procedure call
•   Populate a TVP, and then pass it around
    – It’s a single parameter
    – Pass from procedure to procedure on the server
    – Pass from client to server across the network
•   Based on User-Defined Table Types
    – Defines the schema, just like an ordinary table
    – Simply declare a variable as the type to get a TVP
•   Stored in tempdb
    – Created and destroyed automatically behind the scenes
    – Can be indexed
Creating a User-Defined Table Type



 CREATE TYPE CustomerUdt AS TABLE
   (Id int,
    CustomerName nvarchar(50),
    PostalCode nvarchar(50))


 DECLARE @BestCustomers AS CustomerUdt
Table-Valued
Parameters
TVP Limitations

•   TVPs are read-only, once populated and passed
    – You must apply the READONLY keyword when declaring
      TVPs in stored procedure signatures
    – OUTPUT keyword cannot be used
    – You cannot update, insert or delete
•   No ALTER TABLE…AS TYPE statement
    – To change the schema, it must be dropped and re-created
    – All dependent objects must also be dropped and re-created
•   Statistics are not maintained on TVPs
MERGE
MERGE

•   Four statements in one
    –   SELECT
    –   INSERT
    –   UPDATE
    –   DELETE
•   And even more…
    – OUTPUT clause
    – INSERT OVER DML
•   Operates on a join
    – Between source and target
    – Type of join based on merge clause
•   Start using it now
    – 100% compatible with existing business logic
    – Existing triggers continue to work
MERGE Syntax

   MERGE target
    USING source
    ON join
     WHEN MATCHED
      UPDATE | DELETE
     WHEN NOT MATCHED [BY TARGET]
      INSERT
     WHEN NOT MATCHED BY SOURCE
      UPDATE | DELETE
   ;
MERGE
INSERT OVER DML
DML Output

•   INSERT, UPDATE, DELETE, and MERGE all
    support the OUTPUT clause
    – Captures before-and-after snapshots of modified data via
      INSERTED and DELETED pseudo-tables (just like triggers)
    – MERGE adds $action virtual column (returning INSERT,
      UPDATE or DELETE)
•   OUTPUT INTO can capture the change data to a
    table or table variable
    – Suffers from one limitation – no filtering
    – Solution – use INSERT OVER DML
INSERT OVER DML Syntax


 INSERT INTO target(columns)
  SELECT columns FROM
   (DML statement with OUTPUT)
  CHANGES(columns)
  WHERE filter
DATE AND TIME TYPES
Improved Date and Time Support
•   Start using these four data types
    –   date
    –   time
    –   datetime2
    –   datetimeoffset
•   Stop using these two data types
    – datetime
    – smalldatetime
•   Enhanced storage, portability and functionality
    –   Greater range and precision
    –   More efficient compacted storage
    –   Time zone awareness
    –   All traditional functions support the new types
    –   ODBC, OLE-DB, ADO.NET, SSIS, SSAS, SSRS, Replication
Separate Date and Time Types

•   Only use what you need
    – Eliminate extraneous storage when only date or time is needed
    – Better performance for date-only manipulations and
      calculations
•   For example,
    DECLARE @DOB AS date
    DECLARE @MedsAt AS time(0)
More Portable Dates and Times

•   Value ranges align with .NET and Windows
•   Date Values
    – From 1/1/0001 (DateTime.MinValue)
    – Through 12/31/9999 (DateTime.MaxValue)
    – Legacy datetime type limited to 1/1/1753 through 12/31/9999
•   Time Values
    – Up to 100ns (10-millionth of a second) precision
    – datetime accurate only to roughly hundredth of millisecond,
      smalldatetime to the minute
Time Zone Awareness

•   datetimeoffset type
    – Same range and precision as datetime2
•   Includes the time zone
    – Stores an offset ranging from -14:00 to +14:00
    – Does not support DST (daylight savings time)
•   Store local date/time in different regions of the world
    – Values appear to go in and out as local dates/times
•   Internally stored in UTC
    – Automatically converted and treated as UTC for comparisons,
      sorting and indexing
•   You append the time zone…
    – …and SQL Server handles the conversions to and from UTC under
      the covers automatically
Date/Time Accuracy and Storage

•    Date values compacted into 3 bytes
     – One byte less than 4-byte date portion of datetime
     – Greater range in less space!
•    Time values consume 5 bytes at most
     – Supports 100-ns accuracy
•    Pay less for less
     – Reduced storage for times that don’t require high accuracy
     – Specify a scale parameter (0-7) on time, datetime2 or datetimeoffset
       types
     – 0 = No decimal precision in 3 bytes
     – 7 = Greatest decimal precision (100-ns) in 5 bytes
     – Example: DECLARE @FeedingTime time(0)
     – Differing scales compatible for comparison
Date and Time Types
T-SQL Enhancements
(SQL Server 2012)
•   Windowing (OVER Clause) Enhancements
•   New T-SQL Functions in SQL Server 2012
•   The THROW Statement
•   Server-Side Paging
•   The SEQUENCE Object
•   Metadata Discovery
•   Contained Databases
Introducing OVER
•   OVER Clause
    – Exposes a window over the result set for each row
    – Added in SQL Server 2005, along with the ranking
      functions ROW_NUMBER, RANK, DENSE_RANK,
      NTILE
•   Can also be used with aggregate functions
    – SUM, COUNT, MIN, MAX, AVG
    – Doesn’t require GROUP BY
OVER

AcctId   TxnDate     Amount   AcctId   TxnDate     Amount
1        3/10/2012   500      1        3/10/2012   500
1        3/22/2012   250      1        3/22/2012   250
1        3/24/2012   75       1        3/24/2012   75
1        3/26/2012   125      1        3/26/2012   125
2        3/11/2012   500      2        3/11/2012   500
2        3/15/2012   50       2        3/15/2012   50
2        3/22/2012   5000     2        3/22/2012   5000
2        3/24/2012   550      2        3/24/2012   550
2        3/27/2012   95       2        3/27/2012   95
3        3/15/2012   600      3        3/15/2012   600
3        3/22/2012   25       3        3/22/2012   25
3        3/23/2012   125      3        3/23/2012   125
OVER with PARTITION BY

AcctId   TxnDate     Amount   AcctId   TxnDate     Amount
1        3/10/2012   500      1        3/10/2012   500
1        3/22/2012   250      1        3/22/2012   250
1        3/24/2012   75       1        3/24/2012   75
1        3/26/2012   125      1        3/26/2012   125
2        3/11/2012   500      2        3/11/2012   500
2        3/15/2012   50       2        3/15/2012   50
2        3/22/2012   5000     2        3/22/2012   5000
2        3/24/2012   550      2        3/24/2012   550
2        3/27/2012   95       2        3/27/2012   95
3        3/15/2012   600      3        3/15/2012   600
3        3/22/2012   25       3        3/22/2012   25
3        3/23/2012   125      3        3/23/2012   125
OVER with PARTITION BY
    and ORDER BY
AcctId   TxnDate     Amount   AcctId   TxnDate     Amount
1        3/10/2012   500      1        3/24/2012   75
1        3/22/2012   250      1        3/26/2012   125
1        3/24/2012   75       1        3/22/2012   250
1        3/26/2012   125      1        3/10/2012   500
2        3/11/2012   500      2        3/11/2012   50
2        3/15/2012   50       2        3/15/2012   95
2        3/22/2012   5000     2        3/22/2012   500
2        3/24/2012   550      2        3/24/2012   550
2        3/27/2012   95       2        3/27/2012   5000
3        3/15/2012   600      3        3/15/2012   25
3        3/22/2012   25       3        3/22/2012   125
3        3/23/2012   125      3        3/23/2012   600
Window Partitioning and Ordering

•    OVER with PARTITION BY
     – Optionally groups the result set into multiple windows
•    OVER with ORDER BY
     – Specifies the row sequence in each window
     – Required for the ranking functions
     – Not previously supported for the aggregate functions
•    Now in SQL Server 2012
     – OVER with ORDER BY now supported with aggregate
       functions
     – Window “framing” with ROWS and RANGE
     – Eight new analytic windowing functions
Windowing
(OVER Clause)
New T-SQL Analytic Functions
•    FIRST_VALUE
     – Returns a column value from the first row of the window
•    LAST_VALUE
     – Returns a column value from the last row of the window
•    LAG
     – Returns a column value from a previous row of the window
•    LEAD
     – Returns a column value from a subsequent row of the window
•    PERCENT_RANK
     – Calculate percentile as (RANK – 1) / (N – 1)
•    CUME_DIST
     – Calculate percentile as RANK / N
•    PERCENTILE_DISC
     – Returns a discreet column value at the specified percentile
•    PERCENTILE_CONT
     – Returns a value based on the scale of column values at the
       specified percentile
More New T-SQL Functions

•   Logical         •   Date/Time
    – CHOOSE            – DATEFROMPARTS
    – IIF               – TIMEFROMPARTS
•   String              – DATETIME2FROMPARTS
    – CONCAT            – DATETIMEOFFSETFROMPARTS
    – FORMAT            – DATETIMEFROMPARTS
•   Conversion          – SMALLDATETIMEFROMPARTS
    – TRY_CONVERT       – EOMONTH
    – PARSE         •   Math
    – TRY_PARSE         – LOG (changed)
New SQL Server 2012
T-SQL Functions
The THROW Statement

•    SQL Server 2005 added TRY/CATCH
     – Borrowed from .NET’s try/catch model
     – Vast improvement over repeatedly testing @@ERROR
     – Still used RAISERROR for generating errors
•    SQL Server 2012 adds THROW
     – Recommended alternative way to generate your own errors
     – Does not entirely replace RAISERROR
•    Two usages for THROW
     – With error code, description, and state parameters (like
       RAISERROR)
     – Inside a CATCH block with no parameters (re-throw)
THROW vs. RAISERROR
THROW                                    RAISERROR
Can only generate user exceptions        Can generate user (>= 50000) and
(unless re-throwing in CATCH block)      system (< 50000) exceptions
Supplies ad-hoc text; doesn’t utilize    Requires user messages defined in
sys.messages                             sys.messages (except for code 50000)
Doesn’t support token substitutions      Supports token substitutions
Always uses severity level 16 (unless    Can set any severity level
re-throwing in a CATCH block)
Can re-throw original exception caught   Always generates a new exception; the
in the TRY block                         original exception is lost to the client
Error messages are buffered, and don’t Supports WITH NOWAIT to immediate
appear in real-time                    flush buffered output on error
THROW
Server-Side Paging

•    New result paging keywords
     • Append to ORDER BY clause
     • Limits the number of rows returned
•    OFFSET @start ROWS
     • The first result row to return (zero-based)
•    FETCH NEXT @count ROWS
     – The number of rows to return
Server-Side Paging
Sequences
•    Sequential Number Generator
     – As found in Oracle and DB2
     – Alternative to using IDENTITY for assigning new primary keys
•    Advantages over IDENTITY
     – SET IDENTITY INSERT ON/OFF not needed for inserts
     – Can obtain next sequence value without performing an insert
•    Create a Sequence Object
     CREATE SEQUENCE MySequence
      START WITH 1
      INCREMENT 1
      MINVALUE 1
      NO MAXVALUE

•    Retrieve Sequence Values
     INSERT INTO MyTable(Id, ...)
      VALUES(NEXT VALUE FOR MySequence, ...)
Sequences
Metadata Discovery

•    New system stored procedures and data
     management views
•    sys.sp_describe_first_result_set
     – Analyzes a T-SQL statement and returns information describing the
       schema of the statement’s result set
•    sys.dm_exec_describe_first_result_set
     – Similar, but implemented as a table-valued function to support
       filtering
•    sys.dm_exec_describe_first_result_set_for_object
     – Similar, but accepts an OBJECT_ID of a T-SQL object in the
       database to be analyzed, rather than a T-SQL statement
•    sys.sp_describe_undeclared_parameters
     – Analyzes a T-SQL statement and returns information describing the
       parameter(s) required by the statement
Metadata Discovery
Contained Databases
•   Databases are not entirely self-contained
    – They have external instance-level dependencies
    – Logins, collations, tempdb, linked servers, endpoints,
      etc.
•   SQL Server 2012 provides partial
    containment
    – Makes databases more portable
    – Enables (but does not enforce) containment
•   Can store logins (with passwords) in the
    database
    – Users authenticate directly at the database level
•   sys.dm_db_contained_entities
    – Discovers threats to containment
Contained Databases
PART III




  BUSINESS INTELLIGENCE
MICROSOFT’S BI STACK
AND SQL SERVER’S ROLE
IN IT
Microsoft Business Intelligence
   Business User Experience       Familiar User Experience
                                  Self-Service access & insight
                                  Data exploration & analysis
                                  Business Collaboration
                                  Predictive analysis
                                  Platform
                                  Data visualization
                                  Dashboards & Scorecards
Business Collaboration Platform   Contextual visualization
                                  Excel Services
                                  Databased forms &
                                  Web Infrastructure
                                  workflow
                                  and BI Platform
                                  Collaboration
                                  Analysis Services
                                  Search
                                  Reporting Services
     Information Platform
                                  Content Management
                                  Integration Services
                                  LOB data integration
                                  Master Data Services
                                  Data Mining
                                  Data Warehousing
SQL Server 2008 BI Components
But Wait, There’s More!
•   R2: PowerPivot
•   R2: Report Parts in SSRS
•   2012: Analysis Services Tabular mode
    – And corresponding improvements in PowerPivot
•   2012: Power View
•   2012: Data Quality Services

•   How to get through it all? Here’s the
    menu…
The Appetizer
•   Learn Data Warehousing/BI terms and
    concepts.
The Main Course
•   Build a multidimensional cube
    – Query in Excel
•   Build a PowerPivot model
    – Query that from Excel too.
    – Publish to SharePoint
•   Upsize the PowerPivot model to SSAS
    tabular model
    – Add advanced features
    – Query from Excel
•   Analyze tabular model from Power View
Dessert
•   Reporting Services
    – Report Builder and Report Parts
•   PerformancePoint Services
•   Overviews of
    – Data Quality Services
    – Master Data Services
    – StreamInsight
BI CONCEPTS, ANALYSIS
SERVICES
Business Intelligence
Preparing For Business
Intelligence


                          Data
  • Transactions        Warehouse
  • Process         • Data
                    • Relationships
                    • Analysis
      Transaction
       Database
Dimensional Model
•   Measure
•   Dimension
•   Hierarchy
•   Grain
•   Star Schema
Star Schemas                                         Country

•   Physical data model
•   Central fact table
•   Multiple dimension
                                     Shipper                                Year
    tables
    – Used to constrain fact table
                                                         Total
      queries                                            Sales




                                                                   Sales
                                               Product
                                                                   Person
Example Data Request

•   Get Total Sales By State, By Month for a
    Calendar Year For Country = USA and
    Calendar Year = 1996
Data Warehouse Query
Data Migration


                          Data
• Transactions          Warehouse    • Multi-
• Process          • Data              dimensional
                   • Relationships   • Hierarchical
                   • Analysis
     Transaction                            OLAP
      Database                             Database
SQL Server Analysis Services
•   Built for analysis
•   It is free with SQL Server
•   And you can use the Microsoft stack that you
    know and love
From Data Warehouse to OLAP
    Dimensions
•  Measure
   Dimension
•Aggregations
      – Can have Hierarchies   Fact Table

•    Cube
                               Measures
Building OLAP Cube With BIDS
•   Business Intelligence Development Studio
    – AKA Visual Studio
•   Business Intelligence Projects
    – Analysis Services Project Type
      Add Data Source
      Add Data Source View
      Add Cube
       Add Dimensions
       Add Measures
      Deploy the Cube
Creating an
SSAS Project
The Basics
Advanced OLAP
•   Calculated Members
•   Key Performance Indicators
•   Perspectives
•   And:
    – MDX
    – Actions
    – Partitions
    – Aggregations
    – Translations
QUERYING CUBES FROM
YOUR APPLICATIONS
SSAS Interfaces
     C++ App              VB App            .NET App                        Any App
OLEDB for OLAP/DM       ADO/DSO      ADOMD.NET         AMO          Any Platform, Any Device


                                                           WAN


            XMLA                                                       XMLA
        Over TCP/IP                                                 Over HTTP


                            Analysis Server (msmdsrv.exe)
               OLAP                             Data Mining
           Server ADOMD.NET                                DM Interfaces


         .NET Stored Procedures     Microsoft Algorithms         Third Party Algorithms
ADOMD.NET Client
PRESENTATION
TECHNOLOGIES
Presenting Your Cube
                                                           Excel Services
                               PerformancePoint Services
          Reporting Services




                                            Excel


 SQL
Server



Oracle
 DB2


 Tera-
 Data
The SSAS/Excel/SharePoint Loop

                      Build models
                       with SSAS
                       Multidim’l,
                       Tabular or
                       PowerPivot
      Visualize +                       Query from
     Analyze with                          Excel
        SSRS/                         PivotTables and
    Excel Services/
   PerformancePoint
                                          Charts
       Services
    OR Power View
                        Publish to
                       SharePoint
                        (via Excel
                      Services) and
                       query in the
                         browser
EXCEL BI
PivotStuff
•   PivotTable, and linked charts (sometimes
    referred to as PivotCharts) work extremely well
    with OLAP cubes
•   How to create a PivotTable:
    – Ribbon’s Data tab (From Other Sources button/From Analysis
      Services option or Existing Connections button)
    – Insert tab (PivotTable “split button”)
•   How to insert a chart
    – PivotChart button on PivotTable Tools/Options tab
    – Several others
PivotCharts and
PivotTables
Formula Language CUBE
    Functions
•   CUBEMEMBER and CUBEVALUE
    – Also CUBEKPIMEMBER, CUBEMEMBERPROPERTY,
      CUBERANKEDMEMBER, CUBESET and CUBESETCOUNT
•   IntelliSense style support
    – In a cell, type “=CU” and all CUBE formulas will display
    – Select one with arrow keys and hit Tab
    – When prompted for connection, type " and view pop-up list
    – Other pop-ups activate on " or "."
At Your Service
•   “Range Drag” and relative formula support
    on CUBEVALUE
•   CUBEVALUE and Data Bars go great
    together
•   Ability to convert PivotTables to formulas
CUBExxx Formulas
POWERPIVOT AND EXCEL
SERVICES
Self-Service BI with PowerPivot
•   Excel + Analysis Services + SharePoint
•   Enables the working in Excel but mitigates
    the “spreadmart” pitfalls:
    – Use Analysis Services (AS) as a hidden engine
      Instead of no engine
    – Share via SharePoint, accessible by all AS clients
      Instead of “deploying” via email
    – Formal data refresh on server
      So data doesn’t get stale, and users don’t have to
      make effort at updating
    – Allow IT to monitor
      So it’s not all rogue
    – Provide path to more rigorous implementations
      Can be upsized to Analysis Services
Column-Oriented Stores
•   Imagine, instead of:
     Employee ID        Age        Income
     1                  43         90000
     2                  38         100000
     3                  35         100000
•   You have:
     Employee ID    1         2             3
     Age            43        38            35
     Income         90000     100000        100000

•   Perf: values you wish to aggregate are adjacent
•   Efficiency: great compression from identical or nearly-
    identical values in proximity
•   Fast aggregation and high compression means huge volumes
    of data can be stored and processed, in RAM
Data Import
•   Relational databases
    – SQL Server (including SQL Azure!), Access
    – Oracle, DB2, Sybase, Informix
    – Teradata
    – “Others” (OLE DB, including OLE DB provider for ODBC)
•   OData feeds, incl. R2/2012 Reporting Services,
    Azure DataMarket, WCF Data Services (Astoria),
    SharePoint 2010 lists, Visual Studio LightSwitch
•   Excel via clipboard, linked tables
•   Filter, preview, friendly names for
    tables/columns
Calculated Columns and DAX
•   Formula-based columns may be created
•   Formula syntax is called DAX (Data Analysis
    eXpressions).
    – Not to be confused with MDX or DMX. Or DACs.
•   DAX expressions are similar to Excel formulas
    – Work with tables and columns; similar to, but distinct from,
      worksheets and their columns (and rows)
•   =FUNC('table name'[column name])
•   =FUNCX('table name', <filter expression>)
•   FILTER(Resellers,[ProductLine] = "Mountain")
•   RELATED(Products[EnglishProductName])
•   DAX expressions can be heavily nested
Import data from
                       almost anywhere

PowerPivot Guidebook   View data
                       in Excel




                        Calculated
                        column
                        entry
                       Sort and filter

                       DAX formula bar

                       Relationship
                       indicator




                       Table tabs
Data and

What’s New?
                Diagram views
                     KPIs
                     Measures

                       Measure
                       grid

              Sort one column
              by another



                   Measure
                   formula
Perspectives
                Default Aggregations   Special Advanced Mode

Diagram View                                                     Reporting
                                                                 properties
                                                               Hierarchies




                                                                 Hide specific
                                                                 columns and
                                                                 tables




                                                          Create relationships
                                                          visually

                                                                 Measures
                                                                 KPIs
PowerPivot Client
Excel Services
•   A component of SharePoint Server 2007/2010;
    requires Enterprise CAL
•   Allows export of workbook, worksheet, or
    individual items to SharePoint report library
    – Works great for PivotTables and Charts!
    – Also for sheets with CUBExxx formulas or conditional
      formatting-driven “scorecards”
•   Content can be viewed in browser
    – Excel client not required
    – Drilldown interactivity maintained
    – Rendered in pure HTML and JavaScript
    – Parameterization supported
PowerPivot Server
•   Publish to Excel Services
•   Viewing and interacting
•   Data Refresh
•   Treating as SSAS cube
    – 2008 R2 version: URL to .xlsx as server name
    – 2012 version: use POWERPIVOT named instance and treat
      just like SSAS
      Db name is GUID-based; best to discover it
    – Use Excel, Reporting Services as clients
      And now Power View too…more later
The IT Dashboard




Increase IT efficiency:
  Familiar Technologies
  for Authoring, Sharing,
  Security, and
  Compliance
  Customizable IT
  Dashboard
  Visualize usage with
  animated charts
                            Simplify management of SSBI content using
                              IT Operations Dashboard for SharePoint
PowerPivot Server
Analysis Services Tabular Mode
•   SSAS Tabular Mode is the
    enterprise/server implementation of
    PowerPivot
•   You must have a dedicated tabular mode
    SSAS instance
•   Tabular SSAS projects: BI Developer
    Studio (BIDS) gone PowerPivot
    – Implements equivalent tooling to PowerPivot Window
    – Can create an SSAS tabular database project by
      importing an Excel workbook with PowerPivot model
•   SSAS tabular models support partitions
    and roles
SSAS Tabular Project in BIDS

                               SSAS tabular project
                               menus and toolbar




                                Measure grid and
                                formula bar




                               Reporting properties
                               in Properties window
DirectQuery Mode
•   In DQ mode, model
    defines schema,
    but is not used for
    data
•   Queries issued
    directly against
    source
•   Similar to ROLAP
    storage for
    conventional cubes
•   Combine with
    xVelocity
    ColumnStore
    indexes for fast,
    real-time querying
SSAS Tabular Mode
POWER VIEW
What is Power View?
•   Ad hoc reporting. Really!
•   Analysis, data exploration
•   Data Visualization
•   In Silverlight, in the browser, in SharePoint
•   Feels a little like Excel BI
•   Is actually based on SSRS
    – Power View makes a special RDL file
Power View Data Sources
•   Power View works only against
    PowerPivot/SSAS tabular models
    – DirectQuery mode supported, however
•   For PowerPivot, click “Create Power View
    Report” button or option on workbook in
    SharePoint PowerPivot Gallery
•   For SSAS tabular model, create BISM data
    source, then click its “Create Power View
    Report” button or option
    – BISM data sources can point to PowerPivot
      workbooks too, if you want.
In the browser,

Power View!   in Silverlight




                                Ribbon, like Excel




                                 Variety of
                                 visualizations
                                 and data formats
                                Field list, like Excel



                                Data regions pane,
                                like Excel
View Modes


             Maximize one
             chart,
             fit report to
             window, put whole
             report
             in Reading Mode
             or
             Full Screen

             Create multiple pages
             (views)
Power View Basics
Constraining Your Data
In Power View
•   Tiles
    – A filtering mechanism within a visualization
•   Highlighting
    – Selection in one visualization affects the others
•   Slicers
    – Similar to Excel against PowerPivot
•   True Filters
    – Checked drop-down list; very Excel-like
    – Right-hand filter pane, similar to SSRS and Excel
      Services
Power View Filtering
Scatter/Bubble Charts
•   Allow for several measures
•   Features a “play” axis which can be
    manipulated through a slider or animated
•   Excellent way to visualize trends over time
Multipliers
•   Multiple charts within a chart, in columns,
    rows, or a matrix
    – Horizontal and vertical multipliers
•   Allows for visualizing 1 or 2 additional
    dimensions
Advanced Properties
•   Setting the representative column and
    image tells Power View how to summarize
    your data, and show stored images
•   Other properties tell it about key
    attributes, default aggregations and more
•   Reminder: “DirectQuery” mode tells
    Power View to get data from relational
    data source instead of columnar cache
    – Use with columnstore indexes to have the best of both
      worlds
    – columnstore indexes require Enterprise Edition,
      available in BI Edition
Power View
Advanced Features
Vocabulary
•   MOLAP: Multidimensional OLAP
•   UDM: Unified Dimensional Model
•   Cube: unit of schema in a dimensional
    database

•   xVelocity Columnstore Technology:
    PowerPivot/SSAS’ column store engine
•   VertiPaq: Old name for xVelocity
•   BISM: BI Semantic Model
•   IMBI: In-Memory BI engine
•   Tabular: a column store-based model
    – Because it uses tables, not cubes
xVelocity Columnstore Indexes
•   Implementation of xVelocity columnar technology
    engine for SQL Server relational databases
    – Code name was: “Apollo”
•   Use it by creating a columnstore index
    – CREATE COLUMNSTORE INDEX index ON table (col1,
      Col2, …)
•   Can ignore it in a SELECT, too:
    – OPTION (IGNORE_NONCLUSTERED_COLUMNSTORE_INDEX)
•   Can significantly increase performance of star join
    queries (i.e. aggregating queries with dimension
    lookups).
•   Must enable “batch” mode as well – look @ query
    plan to confirm!
•   Not as good as SSAS, but better than plain old
    GROUP BY
REPORTING SERVICES
AND REPORT BUILDER
Scalable, Enterprise Reporting
    Platform
•   Author Impactful Reports
    • Powerful Designers
    • Flexible Report Layout
    • Rich Visualizations

•   Manage any Workload
    • Enterprise Scale Platform
    • Central Deployment
    • Strong Manageability

•   Deliver Personalized Reports
    • Interactive Reports
    • Rendering in the Format Users Want
    • Delivery to Location Users Want
Self-Service Report Authoring
Report Builder 3.0
  Familiar Microsoft Office Interface   Powerful Query Designer
  Powerful Wizards                      Flexible Layout Options w/ rich
                                        visualizations
  SharePoint list as data source
                                        PowerPivot as data source
Rich Visualizations
SSRS + SSAS = YES(S)
•   Reporting Services can query Analysis
    Services databases, including
    multidimensional cubes and tabular
    models, directly. PowerPivot too.
•   Uses MSOLAP OLE DB provider and
    issues MDX queries
    – Has its own query designer for MDX
•   Beware: SSRS essentially “flattens” SSAS
    data
    – Conforming multidimensional data to relational
      structures
Self-Service Reporting?
•   Fact: Reporting Services is powerful
•   Fact: the data visualizations in SSRS are some of
    the best in the BI stack
•   Fact: None of that makes SSRS report design
    end-user-friendly
•   Building SSRS reports, and especially charts,
    gauges, etc. from scratch is tedious
•   Until now, best end-user option has been to copy
    an existing report and tweak it. Yech!
•   There must be a better way…
Report Parts to the Rescue
•   Skilled SSRS designers can publish report parts
    – From Report Builder 3.0 or VS report projects
•   End users can pick them from a gallery
    – A task pane, in Report Builder 3.0, with search capability
    – Cannot select from VS report designer
•   What can be published?:
    –   Tablixes (i.e. tables, matrices)
    –   Rectangles
    –   Images, Charts, Gauges, Maps
    –   Parameters and Lists
•   All aided by new ability to share Datasets and
    original ability to share Data Sources
Easy to Publish; Easy to Select
SSRS Report Parts
PERFORMANCEPOINT
SERVICES
PerformancePoint Services (PPS)



            Scorecards            Analytics

            Cascading             Multi-dimensional
            scorecards with       slice and dice for
            interactive charts    advanced analytics
            and data from         including
            multiple sources      decomposition tree,
                                  performance map,
                                  and perspective
                                  view
PPS Capabilities
•   Analytic Grids & Charts
    – PPS’ own data visualizations
    – AJAX-based interactive analytics capabilities
•   Scorecards
    – Key Performance Indicators
    – Objectives
    – Dimensions
•   Dashboards
    – Bird’s eye view of business activities
    – Display Analytic Grids and Charts; Scorecards
    – Integrate SSRS, Excel Services (including PowerPivot) content
    – Add Filters
PerformancePoint Services
A Finished Dashboard
MASTER DATA SERVICES,
DATA QUALITY SERVICES
AND STREAMINSIGHT
MDS: Microsoft’s Master Data
Management (MDM) tool

•   Examples:
    –   Sales states, countries, currencies, customer types
    –   Customers, products
    –   Think of “lookup tables” or just think of dimensions!
    –   Slowly changing non-transactional entities in your data
•   What gets stored:
    – Schemas
    – Any hierarchies
    – The data!
•   Other features:
    – Collections, business rules, security, workflows
    – Versioning
Other Facts
•   Result of acquisition of Stratature
•   v1 is an ASP.NET application; UI is “different”
•   New in v2 (SQL Server 2012):
    • Now Silverlight-based; UI is still “different”
    • Excel add-in for data entry; creation of entities and attributes
    • Perform matching with DQS before loading
•   Includes .NET and Web Services APIs for
    reading/writing data and creating/editing models
•   Does not integrate with Analysis Services tools even
    though many of its features and concepts mirror
    those of dimension designer
•   Catalog kept in SQL Server database
•   Deployment packages can be created, shared and
    deployed
Objects in MDS

•   Models
    – Entities (like tables or SSAS dimensions)
      Attributes (like columns/fields or SSAS attributes)
           Common attributes are Name and Code
      Attribute Groups
           Used to taxonomize attributes within tabs in UI
      Members (like rows/records or SSAS members)
      Hierarchies (like SSAS hierarchies)
       Derived or Explicit
      Collections (like SSAS named sets)
    – Versions
    – Business rules
    – Workflows
Data Quality Services
•   Data Cleansing Tool
•   New to SQL Server 2012
•   Result of Zoomix acquisition
•   Uses Artificial Intelligence algorithms to
    detect invalid data and perform matching
    (for de-duplication)
•   Allows manual intervention, too
•   Can integrate with MDS and SSIS
•   Cleaner data = better adoption of your BI
    project
DQS Concepts
•   Knowledge Bases
    – Domains
      “semantic representation[s] of a type of data in a data
      field…[contain] a list of trusted values, invalid values,
      and erroneous data.”
    – Mapping
•   Data Quality Projects
    – Cleansing (i.e. correcting)
      Validate Using Reference Data Services and Azure
      DataMarket (or 3rd party providers)
    – Matching (i.e. de-duping)
    – Confidence
    – Profiling, Monitoring
StreamInsight

•   Microsoft’s Complex Event Handling (CEP)
    Product
•   Processes data streams that are fast and high-
    volume
•   Highly parallel C++ code assures low latency,
    high throughput
•   Not based on SQL Server, though that is its “ship
    vehicle”
•   Interesting collaborative potential with BizTalk
    and SSIS
StreamInsight Concepts

•   No UI. All interaction is programmatic.
•   Based on adapter architecture
    – Input and output adapters
    – Buy or build
    – Sensors, RFID readers, Web logs, market data streams are
      possible event sources
•   StreamInsight applications
    – Streams and events can be queried via LINQ from .NET
    – Server can run in-process, or shared
StreamInsight v1.2:
New in SQL Server 2012
•   Resiliency: can take snapshots and
    restore to that saved state after an outage
•   Dev experience: LINQ enhancements
    – Multiple FROM clauses
    – Nested types
•   Extensibility: user-defined stream
    operators now supported
•   Admin features: server-wide and query-
    specific perf counters, Windows event
    logging
•   Included with Web and Standard Editions
Hadoop on Windows
•   Hadoop is the open source implementation of
    Google’s MapReduce distributed processing
    engine
•   MS working with Hortonworks to implement it
    on Windows
    – A full “distro”
    – Window Server, Windows Azure DIY, Windows Azure self-
      serve cluster provisioning
•   Also: ODBC driver for Hive
    – Works with SSRS, SSAS Tabular, PowerPivot and plain
      Excel.
•   Also: JavaScript console in the browser
•   Come to my session on Thursday!
PART IV




 BEYOND RELATIONAL
FILESTREAM
The Need To Stream

•   Data explosion accelerating the creation and
    management of unstructured binary large
    objects (BLOBs)
    – Photos
    – Audio
    – Video
    – Email messages
    – Spreadsheets
    – Documents
    – Etc.
BLOBs And The Database

Two choices
• Store them in the database
• Store them outside the database, either in the file system
  or in a dedicated BLOB store

BLOBs in the database
• varbinary(max) column
• Integrated management
• Transactional
• Simplified programming
• Bloats the structured file
  groups
BLOBs Inside The Database

                             T-SQL



  CustomerId   FirstName   LastName   Picture varbinary(max)
  235          'John'      'Doe'      0x3B0E95AE3B2F02292F0B…
  236          'Sally'     'Smith'    0xF3000EEF293039A2002C…
BLOBs And The Database

Two choices
• Store them in the database
• Store them outside the database, either in the file system
  or in a dedicated BLOB store

BLOBs in the database BLOBs outside the database
• varbinary(max) column          • Path references to file system
• Integrated management          • Separate from the database
• Transactional                  • Not transactional
• Simplified programming         • Complex programming
• Bloats the structured file     • Doesn’t interfere with
  groups                           performance
BLOBs Outside The Database

                 T-SQL                            File I/O



  CustomerId   FirstName   LastName   Picture varchar(max)
  235          'John'      'Doe'      'C:filesjdoe.jpg'
  236          'Sally'     'Smith'    'C:filesssmith.jpg'
BLOBs Using FILESTREAM
•   Transparently store varbinary(max) data in the file system
    – Declare column as “varbinary(max) FILESTREAM”
•   Integrated management
    – BLOBs are logically part of the database (backup, restore, etc.), but stored
      physically separate as a file group mapped to the file system
•   Simplified programming
    – SQL Server transparently links rows in relational tables to BLOBs in the file
      system
    – No developer effort required to maintain references between structured and
      unstructured data
•   Transactional
    – SQL Server integrates with the NTFS file system
    – Database transactions wrap NTFS transactions
•   Performant
    – File system is optimized for streaming
BLOBs Using FILESTREAM

                             T-SQL



  CustomerId   FirstName   LastName   Picture varbinary(max) FILESTREAM
  235          'John'      'Doe'      0x3B0E95AE3B2F02292F0B…
  236          'Sally'     'Smith'    0xF3000EEF293039A2002C…
Enabling the Service for FILESTREAM
•   Security concern of the Windows administrator

•   Set to one of four levels
    –   Disabled
    –   T-SQL only
    –   T-SQL + file system (local only)
    –   T-SQL + file system (remote)
•   Enable it either:
    – During setup
    – With SQL Server Configuration
      Manager
    – No way to script with T-SQL, but
      VBScript file is available on
      CodePlex that provides
      command-line alternative
Enabling the Instance for FILESTREAM
•   Security concern of the SQL Server administrator
    – Windows and SQL admins must agree! 
•   Set to one of three levels
    – Disabled, T-SQL only, T-SQL + file system
•   Enable it either:
    – In SSMS Server Properties dialog




    – In T-SQL, with:
       EXEC sp_configure filestream_access_level, n
       RECONFIGURE
Creating a FILESTREAM Database

•   CREATE DATABASE PhotoLibrary
     ON PRIMARY
      (NAME = PhotoLibrary_data,
       FILENAME = 'C:DBPhotoLibrary_data.mdf'),
     FILEGROUP FileStreamGroup1 CONTAINS FILESTREAM
      (NAME = PhotoLibrary_group2,
       FILENAME = 'C:DBPhotos')
     LOG ON
      (NAME = PhotoLibrary_log,
       FILENAME = 'C:DBPhotoLibrary_log.ldf')
Creating a FILESTREAM Database

•   CREATE DATABASE PhotoLibrary
     ON PRIMARY
      (NAME = PhotoLibrary_data,
       FILENAME = 'C:DBPhotoLibrary_data.mdf'),
     FILEGROUP FileStreamGroup1 CONTAINS FILESTREAM
      (NAME = PhotoLibrary_group2,
       FILENAME = 'C:DBPhotos')
     LOG ON
      (NAME = PhotoLibrary_log,
       FILENAME = 'C:DBPhotoLibrary_log.ldf')
Creating FILESTREAM Columns

•   Table requires ROWGUIDCOL column
    – Attribute applied to a uniqueidentifier (GUID) column
    – Must be primary key or have unique constraint
    – Only one ROWGUIDCOL column is permitted per table
•   Define BLOB columns as “varbinary(max)
    FILESTREAM”
    – Any number of BLOB columns are permitted per table
Getting Started with
FILESTREAM
Introducing SqlFileStream

•   It is not easy, practical, or efficient to
    manipulate BLOBs in T-SQL
•   Build a streaming client with SqlFileStream
    – System.Data.SqlTypes.SqlFileStream
    – Part of System.Data.dll in .NET 3.5 SP1 and higher
    – Inherits from Stream
    – Constructor takes logical path and transaction context
    – Wraps OpenSqlFilestream SQL Server native client API
    – Consumes no SQL Server memory during processing
The SqlFileStream Recipe

•   Begin Transaction
•   INSERT/SELECT row
•   Retrieve BLOB PathName()
•   Retrieve
    GET_FILESTREAM_TRANSACTION_CONTEXT()
•   Create and use SqlFileStream
•   Commit Transaction
BLOBs Using SqlFileStream

                 T-SQL                       SqlFileStream



  CustomerId   FirstName   LastName   Picture varbinary(max) FILESTREAM
  235          'John'      'Doe'      0x3B0E95AE3B2F020B…
  236          'Sally'     'Smith'    0xF3000EEF293039A2…
Using SqlFileStream
FILESTREAM Limitations &
Considerations

•   Mirroring/HADR
    – Not supported with mirroring
    – Supported with HADR (SQL Server 2012 “AlwaysOn”)
•   Transparent Data Encryption (TDE)
    – Does not encrypt files
•   Replication
    – Supported with some restrictions, see BOL
•   Log Shipping
    – Fully supported
    – Primary and secondary servers require SQL Server 2008 or higher
•   Full-Text Search (FTS)
    – Fully supported
FILESTREAM Limitations &
Considerations (cont.)

•   Database Snapshots
    – Not supported for FILESTREAM filegroups
•   Snapshot Isolation Level
    – Wasn’t supported in SQL Server 2008, supported in 2008 R2 and 2012
•   Local NTFS File System
    – Requires local NTFS file system
    – RBS (Remote BLOB Store) API makes SQL Server act as a dedicated
      BLOB store
•   Security
    – Requires mixed-mode (integrated) security
•   SQL Server Express Edition
    – Fully supported
    – Database size limit (4GB in SQL Server 2008, 10GB in 2008 R2 and
      2012) does not include FILESTREAM data
HIERARCHYID
Hierarchical Data Is Not Relational

•   Today’s most common form of hierarchical data
    is XML
•   XML support added in SQL Server 2005 is great,
    if:
    – You want to store and retrieve an entire hierarchy at one time
    – The data is consumed in XML by client applications
•   Parent-child relationships define rigid
    hierarchies
    – Can’t support unlimited breadth and depth
Hierarchical Storage Scenarios

•   Forum and mailing list
    threads
•   Business organization
    charts
•   Content management
•   Product categories
•   File/folder management
    • FileTable in SQL Server 2012
•   Many more…
    – All typically iterated
      recursively
Traditional Self-Join Approach

•   One table
    – Each row is linked to its parent
•   Works, but has limitations
    – CTEs help with recursive queries
    – Still your job to manage updates
    – Manually maintain structure
    – Complex to reparent entire sub-trees
    – Difficult to query
    – Difficult to control precise ordering of siblings
Introducing hierarchyid

•   System CLR data type
    – Extremely compact variable-length format
    – Does not require SQL CLR to be enabled on the server
•   Enables a robust hierarchical structure over a
    self-joining table
    – Each row is a node with a unique hierarchyid value
    – Contains the path in the hierarchy to the node… down to the
      sibling ordinal position
•   Invoke methods in T-SQL
    – Efficiently query the hierarchy
    – Arbitrarily insert, modify, and delete nodes
    – Reparent entire sub-trees with a single update
hierarchyid Methods

•   GetAncestor
•   GetDescendant
•   GetLevel
•   GetReparentedValue
•   GetRoot
•   IsDescendantOf
•   Parse
•   ToString
Indexing hierarchyid Columns

•   Two types of indexes:        Depth-First Index

     – Use one, the other, or
       both as your needs
       dictate
•   Depth-First
    – Create a primary key or
      unique index               Breadth-First Index
•   Breadth-First
    – Create a composite index
      that includes a level
      column
hierarchyid
hierarchyid Example
FILETABLE
Introducing FileTable
•   Builds on FILESTREAM and hierarchyid
•   A “semi”-ordinary table that houses a logical file system
    – Fixed column schema
    – Each row represents a “folder” or “file”
        Column Name         Data Type            Description

        stream_id           uniqueidentifier     Unique row identifier
                            ROWGUIDCOL
        file_stream         varbinary(max)       BLOB content (NULL if directory)
                            FILESTREAM
        name                nvarchar(255)        Name of file or directory

        path_locator        hierarchyid          Location of file or directory within the file
                                                 system hierarchy

    – Plus 10 storage attributes columns (e.g., is directory, created, modified, archive bit)
•   Windows file/directory management API support
    – A Windows file share exposes the FileTable
    – Bi-directional – changes to the table are reflected in the file share and vice versa
BLOBs Using FileTable                            hierarchyid column
                                                 varbinary(max) Name
                                                 Database Rows
                                                 FileTable Name
                                                 Server Machine
                                                         Instance
                                                            Name
                                                 defines logical file Name
                                                 FILESTREAM column
                                                 FILESTREAM Share
                                                 and folder paths contents
                                                 holds each file’s



                    T-SQL         T-SQL                    SqlFileStream



stream_id         name            path_locator      file_stream
27D8D4AD-D100-39… 'Financials'    0xFF271A3562…     NULL
78F603CC-0460-73… 'ReadMe.docx'   0xFF59345688…     0x3B0E956636AE3B2F020B…
207D4A96-E854-01… 'Budget.xlsx'   0xFD0011039A…     0xF3F359000EEF293039A2…
FileTable Prerequisites
•   Prerequisites at the instance level
    – FILESTREAM must be enabled for the instance
•   Prerequisites at the database level
    – Enable non-transactional FILESTREAM access for the
      database (is still transactional internally)
    – Set a root directory name for all FileTables in the database
      (this will become a child in the Windows file share)
    – Use this T-SQL statement:
        CREATE DATABASE … WITH           – or –
        ALTER DATABASE … SET
    – …followed by…
        FILESTREAM(
         NON_TRANSACTED_ACCESS=FULL|READ,
         DIRECTORY_NAME='DatabaseRootDirectory')
Creating a FileTable
•   Create a FileTable in T-SQL
    – CREATE TABLE TableName AS FileTable
•   FileTable has a fixed schema
    – You don’t (can’t) supply a column list
•   Creates logical directory
    – Logical root directory for the FileTable
    – Created beneath the root directory for the database
    – Named after the table, can override by specifying:
      WITH(FileTable_Directory='TableRootDirectory')
    – Exposes a functional Win32 file system
    – Does not support memory-mapped files (does not
      affect remote clients)
GEO-SPATIAL TYPES
SQL Server Spaces Out
 •   Integrate location awareness into any application
     – Long been the domain of sophisticated GIS applications
 •   GIS
     – A system for capturing, storing, analyzing, and managing data and
       associated attributes which are spatially referenced to the earth
 •   Allow a user to interact with information that is
     relevant to locations that they care about:
     – Home, work, school, or vacation destinations
 •   Two geospatial models
     – Planar
     – Geodetic
Spatial Data Types
 •   Two spatial models = Two system CLR types
 •   geometry
     – Planar (flat) model
     – Flat 2-dimensional Cartesian Coordinate system
     – X and Y coordinates with uniform units of measure
     – Use for mapping small areas
 •   geography
     – Geodetic (round-earth) model
     – Latitude and longitude
     – Use for larger mapping where land mass is too big to fit on
       one planar projection
Planar Spatial Model

 •   Two-Dimensional Surface
     – X and Y coordinates on an arbitrary plane
 •   Flat Earth Projection
     – To work with geospatial data on a 2D surface, a projection is
       created to flatten the geographical objects on the spheroid
     – Example: Planar Model based on Mercator Projection

                      Greenland            Square KM:
                 North
                                           - Antarctica = 13 million
                 America                   - Greenland = 2 million
                                  Africa
                                           - N. America = 24 million
                                           - Africa = 30 million

                              Antarctica
Geodetic Spatial Model
 •   Accurate geographic measurements
     – Locations on planet surface described by latitude and
       longitude angles
 •   Ellipsoidal sphere
     – Latitude = angle N/S of the equator
     – Longitude = angle E/W of the Prime Meridian
Spatial Data Standards
 •   Open Geospatial Consortium (OGC)
     – International standards body
 •   Microsoft belongs to the OGC
     – SQL Server 2008 uses the OGC’s Simple Feature Access
       standards
 •   OpenGIS Simple Feature Interface Standards (SFS)
     – A well-defined way for applications to store and access spatial data
       in relational databases
     – Described using vector elements; such as points, lines and
       polygons
 •   Three ways to import geospatial data
     – Well-Known Text (WKT)
     – Well-Known Binary (WKB)
     – Geographic Markup Language (GML)
Well-Known Text (WKT)

•   WKT examples:
    • POINT(6 10)
    • POINT(-111.06687 45.01188)
    • LINESTRING(3 4,10 50,20 25)
    • POLYGON((1 1,5 1,5 5,1 5,1 1),(2 2, 3 2, 3 3, 2 3,2 2))
    • POLYGON((
      -75.17031 39.95601, -75.16786 39.95778,
      -75.17921 39.96874, -75.18441 39.96512,
      -75.17031 39.95601))
    • MULTIPOINT(3.5 5.6,4.8 10.5)
    • MULTILINESTRING((3 4,10 50,20 25),(-5 -8,-10 -8,-15 -4))
    • GEOMETRYCOLLECTION(POINT(4 6),LINESTRING(4 6,7 10))
    • CIRCULARSTRING(1 5, 6 2, 7 3)
Geospatial Methods
 •   STArea
 •   STBuffer
 •   STCentroid
 •   STDifference
 •   STDimension
 •   STDistance
 •   STEnvelope
 •   STGeomFromText
 •   STIntersection
 •   STIntersects
 •   STPointFromText, STLineFromText, STPolyFromText
 •   STPointFromWKB, STLineFromWKB, STPolyFromWKB
 •   STSymDifference
 •   STUnion
 •   GeomFromGml
 •   Parse
 •   ToString
 •   and more (about 70 total)
Geo-Spatial Types
0,0                     150,0          300,0

      50,50



              100,100




0,150                   150,150
                                     300,150


20,180                     180,180




                        150,300      300,300
Spatial Improvements In
SQL Server 2012
 •   Circular Arcs
     • CircularString
     • CompoundCurve
     • CurvePolygon
 •   All existing methods work on circular objects
 •   New spatial methods
     • BufferWithCurves
     • STNumCurves, STCurveN
     • STCurveToLine
     • CurveToLineWithTolerance
     • IsValidDetailed
     • HasZ, HasM, AsBinaryZM
     • ShortestLineTo
     • UnionAggregate, EnvelopeAggregate, CollectionAggregate,
       ConvexHullAggregate
     • MinDbCompatibilityLevel
Spatial Improvements In
SQL Server 2012
•   Improved Precision
    • Constructions and relations use 48 bits of precision (previously 27 bits)
•   geography Enhancements
    • Support for objects larger than a logical hemisphere (“FullGlobe”)
    • Support for new and previous “geometry-only” methods
•   New SRID
    • Spatial reference ID 104001 (sphere of radius 1)
•   Performance Improvements
    • Better tuning and hints
    • Auto Grid indexing with 8 levels (previously 4 levels)
•   Other Improvements
    • New histogram stored procedures
    • Support for persisted computed columns
Resources

  •   Workshop slides and code
      – http://sdrv.ms/VSLiveNY2012SQL

  •   Aaron Bertrand’s Blog
      – http://sqlblog.com/blogs/aaron_bertrand
  •   Bob Beauchemin’s Blog
      – http://sqlskills.com/BLOGS/BOBB
  •   Itzik Ben-Gan’s Web Site
      – http://www.sql.co.il
  •   James Serra’s Blog
      – http://www.jamesserra.com
  •   simple-talk – Learn SQL Server
      – http://www.simple-talk.com/sql/learn-sql-server
Thank You!

 •   Contact us
     – andrew.brust@bluebadgeinsights.com
     – lenni.lobel@sleektech.com
 •   Visit our blogs
     – brustblog.com
     – lennilobel.wordpress.com
 •   Follow us on Twitter
     – @andrewbrust
     – @lennilobel
 •   Thanks for coming! 

Contenu connexe

Tendances

Modernizing ETL with Azure Data Lake: Hyperscale, multi-format, multi-platfor...
Modernizing ETL with Azure Data Lake: Hyperscale, multi-format, multi-platfor...Modernizing ETL with Azure Data Lake: Hyperscale, multi-format, multi-platfor...
Modernizing ETL with Azure Data Lake: Hyperscale, multi-format, multi-platfor...Michael Rys
 
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)Jason L Brugger
 
Azure Data Lake and U-SQL
Azure Data Lake and U-SQLAzure Data Lake and U-SQL
Azure Data Lake and U-SQLMichael Rys
 
Azure data factory
Azure data factoryAzure data factory
Azure data factoryBizTalk360
 
Sql Bits 2020 - Designing Performant and Scalable Data Lakes using Azure Data...
Sql Bits 2020 - Designing Performant and Scalable Data Lakes using Azure Data...Sql Bits 2020 - Designing Performant and Scalable Data Lakes using Azure Data...
Sql Bits 2020 - Designing Performant and Scalable Data Lakes using Azure Data...Rukmani Gopalan
 
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)Michael Rys
 
Azure Data Factory Data Flows Training v005
Azure Data Factory Data Flows Training v005Azure Data Factory Data Flows Training v005
Azure Data Factory Data Flows Training v005Mark Kromer
 
Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...
Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...
Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...Michael Rys
 
MS SQL SERVER: Programming sql server data mining
MS SQL SERVER: Programming sql server data miningMS SQL SERVER: Programming sql server data mining
MS SQL SERVER: Programming sql server data miningDataminingTools Inc
 
From Raw Data to Analytics with No ETL
From Raw Data to Analytics with No ETLFrom Raw Data to Analytics with No ETL
From Raw Data to Analytics with No ETLCloudera, Inc.
 
Azure Data Factory
Azure Data FactoryAzure Data Factory
Azure Data FactoryHARIHARAN R
 
Deep Dive Redshift, with a focus on performance
Deep Dive Redshift, with a focus on performanceDeep Dive Redshift, with a focus on performance
Deep Dive Redshift, with a focus on performanceAmazon Web Services
 
Using SSRS Reports with SSAS Cubes
Using SSRS Reports with SSAS CubesUsing SSRS Reports with SSAS Cubes
Using SSRS Reports with SSAS CubesCode Mastery
 
AWS July Webinar Series: Amazon Redshift Reporting and Advanced Analytics
AWS July Webinar Series: Amazon Redshift Reporting and Advanced AnalyticsAWS July Webinar Series: Amazon Redshift Reporting and Advanced Analytics
AWS July Webinar Series: Amazon Redshift Reporting and Advanced AnalyticsAmazon Web Services
 
Oracle & sql server comparison 2
Oracle & sql server comparison 2Oracle & sql server comparison 2
Oracle & sql server comparison 2Mohsen B
 
Leveraging Azure Databricks to minimize time to insight by combining Batch an...
Leveraging Azure Databricks to minimize time to insight by combining Batch an...Leveraging Azure Databricks to minimize time to insight by combining Batch an...
Leveraging Azure Databricks to minimize time to insight by combining Batch an...Microsoft Tech Community
 
U-SQL Partitioned Data and Tables (SQLBits 2016)
U-SQL Partitioned Data and Tables (SQLBits 2016)U-SQL Partitioned Data and Tables (SQLBits 2016)
U-SQL Partitioned Data and Tables (SQLBits 2016)Michael Rys
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon RedshiftAmazon Web Services
 
Mapping Data Flows Perf Tuning April 2021
Mapping Data Flows Perf Tuning April 2021Mapping Data Flows Perf Tuning April 2021
Mapping Data Flows Perf Tuning April 2021Mark Kromer
 

Tendances (20)

Modernizing ETL with Azure Data Lake: Hyperscale, multi-format, multi-platfor...
Modernizing ETL with Azure Data Lake: Hyperscale, multi-format, multi-platfor...Modernizing ETL with Azure Data Lake: Hyperscale, multi-format, multi-platfor...
Modernizing ETL with Azure Data Lake: Hyperscale, multi-format, multi-platfor...
 
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
 
Azure Data Lake and U-SQL
Azure Data Lake and U-SQLAzure Data Lake and U-SQL
Azure Data Lake and U-SQL
 
Azure data factory
Azure data factoryAzure data factory
Azure data factory
 
Sql Bits 2020 - Designing Performant and Scalable Data Lakes using Azure Data...
Sql Bits 2020 - Designing Performant and Scalable Data Lakes using Azure Data...Sql Bits 2020 - Designing Performant and Scalable Data Lakes using Azure Data...
Sql Bits 2020 - Designing Performant and Scalable Data Lakes using Azure Data...
 
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
 
Azure Data Factory Data Flows Training v005
Azure Data Factory Data Flows Training v005Azure Data Factory Data Flows Training v005
Azure Data Factory Data Flows Training v005
 
Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...
Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...
Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...
 
MS SQL SERVER: Programming sql server data mining
MS SQL SERVER: Programming sql server data miningMS SQL SERVER: Programming sql server data mining
MS SQL SERVER: Programming sql server data mining
 
From Raw Data to Analytics with No ETL
From Raw Data to Analytics with No ETLFrom Raw Data to Analytics with No ETL
From Raw Data to Analytics with No ETL
 
Azure Data Factory
Azure Data FactoryAzure Data Factory
Azure Data Factory
 
Deep Dive Redshift, with a focus on performance
Deep Dive Redshift, with a focus on performanceDeep Dive Redshift, with a focus on performance
Deep Dive Redshift, with a focus on performance
 
Using SSRS Reports with SSAS Cubes
Using SSRS Reports with SSAS CubesUsing SSRS Reports with SSAS Cubes
Using SSRS Reports with SSAS Cubes
 
AWS July Webinar Series: Amazon Redshift Reporting and Advanced Analytics
AWS July Webinar Series: Amazon Redshift Reporting and Advanced AnalyticsAWS July Webinar Series: Amazon Redshift Reporting and Advanced Analytics
AWS July Webinar Series: Amazon Redshift Reporting and Advanced Analytics
 
Oracle & sql server comparison 2
Oracle & sql server comparison 2Oracle & sql server comparison 2
Oracle & sql server comparison 2
 
Leveraging Azure Databricks to minimize time to insight by combining Batch an...
Leveraging Azure Databricks to minimize time to insight by combining Batch an...Leveraging Azure Databricks to minimize time to insight by combining Batch an...
Leveraging Azure Databricks to minimize time to insight by combining Batch an...
 
U-SQL Partitioned Data and Tables (SQLBits 2016)
U-SQL Partitioned Data and Tables (SQLBits 2016)U-SQL Partitioned Data and Tables (SQLBits 2016)
U-SQL Partitioned Data and Tables (SQLBits 2016)
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon Redshift
 
Mapping Data Flows Perf Tuning April 2021
Mapping Data Flows Perf Tuning April 2021Mapping Data Flows Perf Tuning April 2021
Mapping Data Flows Perf Tuning April 2021
 
ETL
ETL ETL
ETL
 

En vedette

SQL302 Intermediate SQL
SQL302 Intermediate SQLSQL302 Intermediate SQL
SQL302 Intermediate SQLDan D'Urso
 
SQL302 Intermediate SQL Workshop 1
SQL302 Intermediate SQL Workshop 1SQL302 Intermediate SQL Workshop 1
SQL302 Intermediate SQL Workshop 1Dan D'Urso
 
SQL302 Intermediate SQL Workshop 2
SQL302 Intermediate SQL Workshop 2SQL302 Intermediate SQL Workshop 2
SQL302 Intermediate SQL Workshop 2Dan D'Urso
 
SQL302 Intermediate SQL Workshop 3
SQL302 Intermediate SQL Workshop 3SQL302 Intermediate SQL Workshop 3
SQL302 Intermediate SQL Workshop 3Dan D'Urso
 
Geek Sync | Kick Start SQL Server 2016 Performance Tips and Tricks
Geek Sync | Kick Start SQL Server 2016 Performance Tips and TricksGeek Sync | Kick Start SQL Server 2016 Performance Tips and Tricks
Geek Sync | Kick Start SQL Server 2016 Performance Tips and TricksIDERA Software
 
The secret psychology behind social behaviour
The secret psychology behind social behaviourThe secret psychology behind social behaviour
The secret psychology behind social behaviourNathalie Nahai
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architectureAjeet Singh
 
Nathalie Nahai - The secret psychology of persuasive copy (Conversion Confere...
Nathalie Nahai - The secret psychology of persuasive copy (Conversion Confere...Nathalie Nahai - The secret psychology of persuasive copy (Conversion Confere...
Nathalie Nahai - The secret psychology of persuasive copy (Conversion Confere...Nathalie Nahai
 

En vedette (8)

SQL302 Intermediate SQL
SQL302 Intermediate SQLSQL302 Intermediate SQL
SQL302 Intermediate SQL
 
SQL302 Intermediate SQL Workshop 1
SQL302 Intermediate SQL Workshop 1SQL302 Intermediate SQL Workshop 1
SQL302 Intermediate SQL Workshop 1
 
SQL302 Intermediate SQL Workshop 2
SQL302 Intermediate SQL Workshop 2SQL302 Intermediate SQL Workshop 2
SQL302 Intermediate SQL Workshop 2
 
SQL302 Intermediate SQL Workshop 3
SQL302 Intermediate SQL Workshop 3SQL302 Intermediate SQL Workshop 3
SQL302 Intermediate SQL Workshop 3
 
Geek Sync | Kick Start SQL Server 2016 Performance Tips and Tricks
Geek Sync | Kick Start SQL Server 2016 Performance Tips and TricksGeek Sync | Kick Start SQL Server 2016 Performance Tips and Tricks
Geek Sync | Kick Start SQL Server 2016 Performance Tips and Tricks
 
The secret psychology behind social behaviour
The secret psychology behind social behaviourThe secret psychology behind social behaviour
The secret psychology behind social behaviour
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architecture
 
Nathalie Nahai - The secret psychology of persuasive copy (Conversion Confere...
Nathalie Nahai - The secret psychology of persuasive copy (Conversion Confere...Nathalie Nahai - The secret psychology of persuasive copy (Conversion Confere...
Nathalie Nahai - The secret psychology of persuasive copy (Conversion Confere...
 

Similaire à SQL Server Workshop for Developers - Visual Studio Live! NY 2012

Apoyo en la administración de bases de datos mediante microsoft data tools
Apoyo en la administración de bases de datos mediante microsoft data toolsApoyo en la administración de bases de datos mediante microsoft data tools
Apoyo en la administración de bases de datos mediante microsoft data toolsSpanishPASSVC
 
DesignMind SQL Server 2008 Migration
DesignMind SQL Server 2008 MigrationDesignMind SQL Server 2008 Migration
DesignMind SQL Server 2008 MigrationMark Ginnebaugh
 
What’s new in SQL Server 2017
What’s new in SQL Server 2017What’s new in SQL Server 2017
What’s new in SQL Server 2017James Serra
 
Directions NA Choosing the best possible Azure platform for NAV
Directions NA Choosing the best possible Azure platform for NAVDirections NA Choosing the best possible Azure platform for NAV
Directions NA Choosing the best possible Azure platform for NAVAleksandar Totovic
 
New features of sql server 2016 bi features
New features of sql server 2016 bi featuresNew features of sql server 2016 bi features
New features of sql server 2016 bi featuresChris Testa-O'Neill
 
Introduction to SQL Server Analysis services 2008
Introduction to SQL Server Analysis services 2008Introduction to SQL Server Analysis services 2008
Introduction to SQL Server Analysis services 2008Tobias Koprowski
 
Sql connections germany - migration considerations when migrating your on pre...
Sql connections germany - migration considerations when migrating your on pre...Sql connections germany - migration considerations when migrating your on pre...
Sql connections germany - migration considerations when migrating your on pre...Charley Hanania
 
BI 2008 Simple
BI 2008 SimpleBI 2008 Simple
BI 2008 Simplellangit
 
Building your first Analysis Services Tabular BI Semantic model with SQL Serv...
Building your first Analysis Services Tabular BI Semantic model with SQL Serv...Building your first Analysis Services Tabular BI Semantic model with SQL Serv...
Building your first Analysis Services Tabular BI Semantic model with SQL Serv...Microsoft TechNet - Belgium and Luxembourg
 
Upgrade your SQL Server like a Ninja
Upgrade your SQL Server like a NinjaUpgrade your SQL Server like a Ninja
Upgrade your SQL Server like a NinjaAmit Banerjee
 
SQL Server Developer 70-433
SQL Server Developer 70-433SQL Server Developer 70-433
SQL Server Developer 70-433jasonyousef
 
SQLUpgrade_What_do_I_need_to_know_-_SQLSaturday_Manchester.pptx
SQLUpgrade_What_do_I_need_to_know_-_SQLSaturday_Manchester.pptxSQLUpgrade_What_do_I_need_to_know_-_SQLSaturday_Manchester.pptx
SQLUpgrade_What_do_I_need_to_know_-_SQLSaturday_Manchester.pptxEddie Gonzalez
 
Migrating on premises workload to azure sql database
Migrating on premises workload to azure sql databaseMigrating on premises workload to azure sql database
Migrating on premises workload to azure sql databasePARIKSHIT SAVJANI
 

Similaire à SQL Server Workshop for Developers - Visual Studio Live! NY 2012 (20)

Database Schema Management & Deployment using SQL Server Data Tools (SSDT)
Database Schema Management & Deployment using SQL Server Data Tools (SSDT)Database Schema Management & Deployment using SQL Server Data Tools (SSDT)
Database Schema Management & Deployment using SQL Server Data Tools (SSDT)
 
Apoyo en la administración de bases de datos mediante microsoft data tools
Apoyo en la administración de bases de datos mediante microsoft data toolsApoyo en la administración de bases de datos mediante microsoft data tools
Apoyo en la administración de bases de datos mediante microsoft data tools
 
DesignMind SQL Server 2008 Migration
DesignMind SQL Server 2008 MigrationDesignMind SQL Server 2008 Migration
DesignMind SQL Server 2008 Migration
 
What’s new in SQL Server 2017
What’s new in SQL Server 2017What’s new in SQL Server 2017
What’s new in SQL Server 2017
 
Directions NA Choosing the best possible Azure platform for NAV
Directions NA Choosing the best possible Azure platform for NAVDirections NA Choosing the best possible Azure platform for NAV
Directions NA Choosing the best possible Azure platform for NAV
 
New features of sql server 2016 bi features
New features of sql server 2016 bi featuresNew features of sql server 2016 bi features
New features of sql server 2016 bi features
 
Introduction to SQL Server Analysis services 2008
Introduction to SQL Server Analysis services 2008Introduction to SQL Server Analysis services 2008
Introduction to SQL Server Analysis services 2008
 
Sravya(1)
Sravya(1)Sravya(1)
Sravya(1)
 
It ready dw_day3_rev00
It ready dw_day3_rev00It ready dw_day3_rev00
It ready dw_day3_rev00
 
Sql connections germany - migration considerations when migrating your on pre...
Sql connections germany - migration considerations when migrating your on pre...Sql connections germany - migration considerations when migrating your on pre...
Sql connections germany - migration considerations when migrating your on pre...
 
SQL Server 2016 BI updates
SQL Server 2016 BI updatesSQL Server 2016 BI updates
SQL Server 2016 BI updates
 
BI 2008 Simple
BI 2008 SimpleBI 2008 Simple
BI 2008 Simple
 
Using T-SQL
Using T-SQL Using T-SQL
Using T-SQL
 
Building your first Analysis Services Tabular BI Semantic model with SQL Serv...
Building your first Analysis Services Tabular BI Semantic model with SQL Serv...Building your first Analysis Services Tabular BI Semantic model with SQL Serv...
Building your first Analysis Services Tabular BI Semantic model with SQL Serv...
 
resume
resumeresume
resume
 
Upgrade your SQL Server like a Ninja
Upgrade your SQL Server like a NinjaUpgrade your SQL Server like a Ninja
Upgrade your SQL Server like a Ninja
 
SQL Server Developer 70-433
SQL Server Developer 70-433SQL Server Developer 70-433
SQL Server Developer 70-433
 
SQLUpgrade_What_do_I_need_to_know_-_SQLSaturday_Manchester.pptx
SQLUpgrade_What_do_I_need_to_know_-_SQLSaturday_Manchester.pptxSQLUpgrade_What_do_I_need_to_know_-_SQLSaturday_Manchester.pptx
SQLUpgrade_What_do_I_need_to_know_-_SQLSaturday_Manchester.pptx
 
Manageability Enhancements of SQL Server 2012
Manageability Enhancements of SQL Server 2012Manageability Enhancements of SQL Server 2012
Manageability Enhancements of SQL Server 2012
 
Migrating on premises workload to azure sql database
Migrating on premises workload to azure sql databaseMigrating on premises workload to azure sql database
Migrating on premises workload to azure sql database
 

Plus de Andrew Brust

Azure ml screen grabs
Azure ml screen grabsAzure ml screen grabs
Azure ml screen grabsAndrew Brust
 
Big Data Strategy for the Relational World
Big Data Strategy for the Relational World Big Data Strategy for the Relational World
Big Data Strategy for the Relational World Andrew Brust
 
NoSQL: An Analysis
NoSQL: An AnalysisNoSQL: An Analysis
NoSQL: An AnalysisAndrew Brust
 
Hitchhiker’s Guide to SharePoint BI
Hitchhiker’s Guide to SharePoint BIHitchhiker’s Guide to SharePoint BI
Hitchhiker’s Guide to SharePoint BIAndrew Brust
 
Big Data and NoSQL for Database and BI Pros
Big Data and NoSQL for Database and BI ProsBig Data and NoSQL for Database and BI Pros
Big Data and NoSQL for Database and BI ProsAndrew Brust
 
Big Data and NoSQL for Database and BI Pros
Big Data and NoSQL for Database and BI ProsBig Data and NoSQL for Database and BI Pros
Big Data and NoSQL for Database and BI ProsAndrew Brust
 
Big Data on the Microsoft Platform - With Hadoop, MS BI and the SQL Server stack
Big Data on the Microsoft Platform - With Hadoop, MS BI and the SQL Server stackBig Data on the Microsoft Platform - With Hadoop, MS BI and the SQL Server stack
Big Data on the Microsoft Platform - With Hadoop, MS BI and the SQL Server stackAndrew Brust
 
Big Data on the Microsoft Platform
Big Data on the Microsoft PlatformBig Data on the Microsoft Platform
Big Data on the Microsoft PlatformAndrew Brust
 
NoSQL and The Big Data Hullabaloo
NoSQL and The Big Data HullabalooNoSQL and The Big Data Hullabaloo
NoSQL and The Big Data HullabalooAndrew Brust
 
A Practical Look at the NOSQL and Big Data Hullabaloo
A Practical Look at the NOSQL and Big Data HullabalooA Practical Look at the NOSQL and Big Data Hullabaloo
A Practical Look at the NOSQL and Big Data HullabalooAndrew Brust
 
Hadoop and its Ecosystem Components in Action
Hadoop and its Ecosystem Components in ActionHadoop and its Ecosystem Components in Action
Hadoop and its Ecosystem Components in ActionAndrew Brust
 
Microsoft's Big Play for Big Data
Microsoft's Big Play for Big DataMicrosoft's Big Play for Big Data
Microsoft's Big Play for Big DataAndrew Brust
 
Big Data and NoSQL in Microsoft-Land
Big Data and NoSQL in Microsoft-LandBig Data and NoSQL in Microsoft-Land
Big Data and NoSQL in Microsoft-LandAndrew Brust
 
Brust hadoopecosystem
Brust hadoopecosystemBrust hadoopecosystem
Brust hadoopecosystemAndrew Brust
 
Microsoft's Big Play for Big Data- Visual Studio Live! NY 2012
Microsoft's Big Play for Big Data- Visual Studio Live! NY 2012Microsoft's Big Play for Big Data- Visual Studio Live! NY 2012
Microsoft's Big Play for Big Data- Visual Studio Live! NY 2012Andrew Brust
 
Power View: Analysis and Visualization for Your Application’s Data
Power View: Analysis and Visualization for Your Application’s DataPower View: Analysis and Visualization for Your Application’s Data
Power View: Analysis and Visualization for Your Application’s DataAndrew Brust
 
Microsoft's Big Play for Big Data
Microsoft's Big Play for Big DataMicrosoft's Big Play for Big Data
Microsoft's Big Play for Big DataAndrew Brust
 
Evolved BI with SQL Server 2012
Evolved BIwith SQL Server 2012Evolved BIwith SQL Server 2012
Evolved BI with SQL Server 2012Andrew Brust
 
Grasping The LightSwitch Paradigm
Grasping The LightSwitch ParadigmGrasping The LightSwitch Paradigm
Grasping The LightSwitch ParadigmAndrew Brust
 
SQL Server Denali: BI on Your Terms
SQL Server Denali: BI on Your Terms SQL Server Denali: BI on Your Terms
SQL Server Denali: BI on Your Terms Andrew Brust
 

Plus de Andrew Brust (20)

Azure ml screen grabs
Azure ml screen grabsAzure ml screen grabs
Azure ml screen grabs
 
Big Data Strategy for the Relational World
Big Data Strategy for the Relational World Big Data Strategy for the Relational World
Big Data Strategy for the Relational World
 
NoSQL: An Analysis
NoSQL: An AnalysisNoSQL: An Analysis
NoSQL: An Analysis
 
Hitchhiker’s Guide to SharePoint BI
Hitchhiker’s Guide to SharePoint BIHitchhiker’s Guide to SharePoint BI
Hitchhiker’s Guide to SharePoint BI
 
Big Data and NoSQL for Database and BI Pros
Big Data and NoSQL for Database and BI ProsBig Data and NoSQL for Database and BI Pros
Big Data and NoSQL for Database and BI Pros
 
Big Data and NoSQL for Database and BI Pros
Big Data and NoSQL for Database and BI ProsBig Data and NoSQL for Database and BI Pros
Big Data and NoSQL for Database and BI Pros
 
Big Data on the Microsoft Platform - With Hadoop, MS BI and the SQL Server stack
Big Data on the Microsoft Platform - With Hadoop, MS BI and the SQL Server stackBig Data on the Microsoft Platform - With Hadoop, MS BI and the SQL Server stack
Big Data on the Microsoft Platform - With Hadoop, MS BI and the SQL Server stack
 
Big Data on the Microsoft Platform
Big Data on the Microsoft PlatformBig Data on the Microsoft Platform
Big Data on the Microsoft Platform
 
NoSQL and The Big Data Hullabaloo
NoSQL and The Big Data HullabalooNoSQL and The Big Data Hullabaloo
NoSQL and The Big Data Hullabaloo
 
A Practical Look at the NOSQL and Big Data Hullabaloo
A Practical Look at the NOSQL and Big Data HullabalooA Practical Look at the NOSQL and Big Data Hullabaloo
A Practical Look at the NOSQL and Big Data Hullabaloo
 
Hadoop and its Ecosystem Components in Action
Hadoop and its Ecosystem Components in ActionHadoop and its Ecosystem Components in Action
Hadoop and its Ecosystem Components in Action
 
Microsoft's Big Play for Big Data
Microsoft's Big Play for Big DataMicrosoft's Big Play for Big Data
Microsoft's Big Play for Big Data
 
Big Data and NoSQL in Microsoft-Land
Big Data and NoSQL in Microsoft-LandBig Data and NoSQL in Microsoft-Land
Big Data and NoSQL in Microsoft-Land
 
Brust hadoopecosystem
Brust hadoopecosystemBrust hadoopecosystem
Brust hadoopecosystem
 
Microsoft's Big Play for Big Data- Visual Studio Live! NY 2012
Microsoft's Big Play for Big Data- Visual Studio Live! NY 2012Microsoft's Big Play for Big Data- Visual Studio Live! NY 2012
Microsoft's Big Play for Big Data- Visual Studio Live! NY 2012
 
Power View: Analysis and Visualization for Your Application’s Data
Power View: Analysis and Visualization for Your Application’s DataPower View: Analysis and Visualization for Your Application’s Data
Power View: Analysis and Visualization for Your Application’s Data
 
Microsoft's Big Play for Big Data
Microsoft's Big Play for Big DataMicrosoft's Big Play for Big Data
Microsoft's Big Play for Big Data
 
Evolved BI with SQL Server 2012
Evolved BIwith SQL Server 2012Evolved BIwith SQL Server 2012
Evolved BI with SQL Server 2012
 
Grasping The LightSwitch Paradigm
Grasping The LightSwitch ParadigmGrasping The LightSwitch Paradigm
Grasping The LightSwitch Paradigm
 
SQL Server Denali: BI on Your Terms
SQL Server Denali: BI on Your Terms SQL Server Denali: BI on Your Terms
SQL Server Denali: BI on Your Terms
 

Dernier

Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sectoritnewsafrica
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 

Dernier (20)

Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 

SQL Server Workshop for Developers - Visual Studio Live! NY 2012

  • 1. SQL Server Workshop for Developers Andrew Brust Leonard Lobel CEO and Founder CTO, Sleek Technologies Blue Badge Insights Principal Consultant, Tallan Level: Intermediate May 14, 2012
  • 2. Meet Andrew • CEO and Founder, Blue Badge Insights • CTO, Tallan, Inc. • Member, Microsoft BI Partner Advisory Council • Microsoft Regional Director, MVP • Co-chair VSLive! and over 15 years as a speaker • Founder, Microsoft BI User Group of NYC – http://www.msbinyc.com • Co-moderator, NYC .NET Developers Group – http://www.nycdotnetdev.com • “Redmond Review” columnist for Visual Studio Magazine and Redmond Developer News • brustblog.com, Twitter: @andrewbrust
  • 3. Andrew’s New Blog (bit.ly/bigondata)
  • 4. Meet Lenni sleek Leonard Lobel technologies • CTO & Co-Founder – Sleek Technologies, Inc. • Principal Consultant – Tallan, Inc. • Microsoft MVP – SQL Server • .NET consultant and trainer • Speaker • Author • Programming since 1979 Contact • Email: lenni.lobel@sleektech.com • Blog: lennilobel.wordpress.com • Twitter: @lennilobel
  • 6. Agenda • Part I – Overview • Part II – T-SQL Enhancements • Part III – Business Intelligence • Part IV – Beyond Relational • Demos, demos, demos! –http://sdrv.ms/VSLiveNY2012SQL
  • 7. Download Slides and Code http://sdrv.ms/ VSLiveNY2012SQL (case sensitive!)
  • 8. PART I OVERVIEW
  • 9. SQL Server Versions • SQL Server 2012 (Version 11) – Newest version of SQL Server – Released March 7, 2012 • SQL Server 2008 R2 (Version 10.5) – Adds powerful BI features to SQL Server 2008 – Released April 21, 2010 • SQL Server 2008 (Version 10) – Released August 6, 2008 • SQL Server 2005 – Revolutionary upgrade from SQL Server 2000 – Integration of multiple services (SSRS, SSAS, SSIS) with the RDBMS • Before SQL Server 2005… – The relational database engine was the product – Added value features (Reporting, OLAP, DTS) through a patchwork of optional add-ons
  • 10. SQL Server Versions • SQL Server 2012 (Version 11) – Newest version of SQL Server – Released March 7, 2012 • SQL Server 2008 R2 (Version 10.5) – Adds powerful BI features to SQL Server 2008 – Released April 21, 2010 • SQL Server 2008 (Version 10) – Released August 6, 2008 • SQL Server 2005 – Revolutionary upgrade from SQL Server 2000 – Integration of multiple services (SSRS, SSAS, SSIS) with the RDBMS • Before SQL Server 2005… – The relational database engine was the product – Added value features (Reporting, OLAP, DTS) through a patchwork of optional add-ons
  • 11. Introducing SQL Server 2012 • The latest major release of SQL Server • Mission Critical Platform – HADR (High-Availability Disaster Recovery) • IT and Developer Productivity – SQL Server Data Tools (SSDT) – T-SQL enhancements – Beyond Relational enhancements (FileTable, FTS improvements) – Geospatial improvements (circular data, full globe, performance) • Pervasive Insight – Columnstore Indexing (xVelocity) – BI Semantic Model (PowerPivot technology) comes to Analysis Services – Real ad hoc reporting and data visualization in Power View – Data lineage and data quality (DQS)
  • 12. BI Foundation • Stack Review – The MS BI Stack – The SQL Server 2008 R2 “sub-stack” – New SQL Server 2012 Components • Analysis Services and OLAP – Dimensional Concepts – Analysis Services cube design – Overview of ADO MD.NET and other APIs
  • 13. BI Delivery • Presentation Layer – Excel BI – PowerPivot and Excel Services Including new PowerPivot features in SQL Server 2012 – Analysis Services tabular databases (SQL Server 2012) – Power View (SQL Server 2012) – Reporting Services and Report Builder – PerformancePoint Services (brief) • Overview: Other New R2/2012 Components – Master Data Services, Data Quality Services – StreamInsight
  • 14. Introducing SQL Server Data Tools • SSDT – Code-named “Juneau” – Next generation IDE for SQL Server development – Declarative, model-based development in connected, offline, and cloud scenarios – New project type: SQL Server Database Project – Visual Studio shell, solutions, projects + (partial) SSMS/Azure functionality + full BIDS • Not intended to replace SSMS – SSMS still the primary dba tool for managing SQL Server • Intended to replace VS DbPro (aka “data dude”) – But not ready to, as it still lacks total feature parity – Missing data generation, data compare, unit testing • Separate Web Platform Installer Download – Updates to ship out-of-band with VS and SQL Server releases
  • 15. Declarative Model-Based Development SQL Server Data Tools (SSDT) Offline Dev/Test On-Premise Cloud DataCenter Database Model SQL Server Database Project SQL Server 2005, Local Database 2008, 2008 R2, Runtime SQL Azure 2012 (LocalDB) Database Snapshot File (.dacpac) Version History
  • 16. SSDT Projects SSDT Relational Analysis Reporting Integration Engine Services Services Services SQL Server Static Analysis Database T-SQL Language Power Buffer Object Explorer and Validation Publish Services Editing Schema Local Database T-SQL Table Designer SQL CLR Compare Runtime Debugging
  • 17. PART II T-SQL ENHANCEMENTS
  • 19. Table-Valued Parameters • Process a set of rows as a single entity – Similar to temp tables, table variables and CTEs – Example: INSERT an entire order (header & details) with only two parameters and one stored procedure call • Populate a TVP, and then pass it around – It’s a single parameter – Pass from procedure to procedure on the server – Pass from client to server across the network • Based on User-Defined Table Types – Defines the schema, just like an ordinary table – Simply declare a variable as the type to get a TVP • Stored in tempdb – Created and destroyed automatically behind the scenes – Can be indexed
  • 20. Creating a User-Defined Table Type CREATE TYPE CustomerUdt AS TABLE (Id int, CustomerName nvarchar(50), PostalCode nvarchar(50)) DECLARE @BestCustomers AS CustomerUdt
  • 22. TVP Limitations • TVPs are read-only, once populated and passed – You must apply the READONLY keyword when declaring TVPs in stored procedure signatures – OUTPUT keyword cannot be used – You cannot update, insert or delete • No ALTER TABLE…AS TYPE statement – To change the schema, it must be dropped and re-created – All dependent objects must also be dropped and re-created • Statistics are not maintained on TVPs
  • 23. MERGE
  • 24. MERGE • Four statements in one – SELECT – INSERT – UPDATE – DELETE • And even more… – OUTPUT clause – INSERT OVER DML • Operates on a join – Between source and target – Type of join based on merge clause • Start using it now – 100% compatible with existing business logic – Existing triggers continue to work
  • 25. MERGE Syntax MERGE target USING source ON join WHEN MATCHED UPDATE | DELETE WHEN NOT MATCHED [BY TARGET] INSERT WHEN NOT MATCHED BY SOURCE UPDATE | DELETE ;
  • 26. MERGE
  • 28. DML Output • INSERT, UPDATE, DELETE, and MERGE all support the OUTPUT clause – Captures before-and-after snapshots of modified data via INSERTED and DELETED pseudo-tables (just like triggers) – MERGE adds $action virtual column (returning INSERT, UPDATE or DELETE) • OUTPUT INTO can capture the change data to a table or table variable – Suffers from one limitation – no filtering – Solution – use INSERT OVER DML
  • 29. INSERT OVER DML Syntax INSERT INTO target(columns) SELECT columns FROM (DML statement with OUTPUT) CHANGES(columns) WHERE filter
  • 30. DATE AND TIME TYPES
  • 31. Improved Date and Time Support • Start using these four data types – date – time – datetime2 – datetimeoffset • Stop using these two data types – datetime – smalldatetime • Enhanced storage, portability and functionality – Greater range and precision – More efficient compacted storage – Time zone awareness – All traditional functions support the new types – ODBC, OLE-DB, ADO.NET, SSIS, SSAS, SSRS, Replication
  • 32. Separate Date and Time Types • Only use what you need – Eliminate extraneous storage when only date or time is needed – Better performance for date-only manipulations and calculations • For example, DECLARE @DOB AS date DECLARE @MedsAt AS time(0)
  • 33. More Portable Dates and Times • Value ranges align with .NET and Windows • Date Values – From 1/1/0001 (DateTime.MinValue) – Through 12/31/9999 (DateTime.MaxValue) – Legacy datetime type limited to 1/1/1753 through 12/31/9999 • Time Values – Up to 100ns (10-millionth of a second) precision – datetime accurate only to roughly hundredth of millisecond, smalldatetime to the minute
  • 34. Time Zone Awareness • datetimeoffset type – Same range and precision as datetime2 • Includes the time zone – Stores an offset ranging from -14:00 to +14:00 – Does not support DST (daylight savings time) • Store local date/time in different regions of the world – Values appear to go in and out as local dates/times • Internally stored in UTC – Automatically converted and treated as UTC for comparisons, sorting and indexing • You append the time zone… – …and SQL Server handles the conversions to and from UTC under the covers automatically
  • 35. Date/Time Accuracy and Storage • Date values compacted into 3 bytes – One byte less than 4-byte date portion of datetime – Greater range in less space! • Time values consume 5 bytes at most – Supports 100-ns accuracy • Pay less for less – Reduced storage for times that don’t require high accuracy – Specify a scale parameter (0-7) on time, datetime2 or datetimeoffset types – 0 = No decimal precision in 3 bytes – 7 = Greatest decimal precision (100-ns) in 5 bytes – Example: DECLARE @FeedingTime time(0) – Differing scales compatible for comparison
  • 36. Date and Time Types
  • 37. T-SQL Enhancements (SQL Server 2012) • Windowing (OVER Clause) Enhancements • New T-SQL Functions in SQL Server 2012 • The THROW Statement • Server-Side Paging • The SEQUENCE Object • Metadata Discovery • Contained Databases
  • 38. Introducing OVER • OVER Clause – Exposes a window over the result set for each row – Added in SQL Server 2005, along with the ranking functions ROW_NUMBER, RANK, DENSE_RANK, NTILE • Can also be used with aggregate functions – SUM, COUNT, MIN, MAX, AVG – Doesn’t require GROUP BY
  • 39. OVER AcctId TxnDate Amount AcctId TxnDate Amount 1 3/10/2012 500 1 3/10/2012 500 1 3/22/2012 250 1 3/22/2012 250 1 3/24/2012 75 1 3/24/2012 75 1 3/26/2012 125 1 3/26/2012 125 2 3/11/2012 500 2 3/11/2012 500 2 3/15/2012 50 2 3/15/2012 50 2 3/22/2012 5000 2 3/22/2012 5000 2 3/24/2012 550 2 3/24/2012 550 2 3/27/2012 95 2 3/27/2012 95 3 3/15/2012 600 3 3/15/2012 600 3 3/22/2012 25 3 3/22/2012 25 3 3/23/2012 125 3 3/23/2012 125
  • 40. OVER with PARTITION BY AcctId TxnDate Amount AcctId TxnDate Amount 1 3/10/2012 500 1 3/10/2012 500 1 3/22/2012 250 1 3/22/2012 250 1 3/24/2012 75 1 3/24/2012 75 1 3/26/2012 125 1 3/26/2012 125 2 3/11/2012 500 2 3/11/2012 500 2 3/15/2012 50 2 3/15/2012 50 2 3/22/2012 5000 2 3/22/2012 5000 2 3/24/2012 550 2 3/24/2012 550 2 3/27/2012 95 2 3/27/2012 95 3 3/15/2012 600 3 3/15/2012 600 3 3/22/2012 25 3 3/22/2012 25 3 3/23/2012 125 3 3/23/2012 125
  • 41. OVER with PARTITION BY and ORDER BY AcctId TxnDate Amount AcctId TxnDate Amount 1 3/10/2012 500 1 3/24/2012 75 1 3/22/2012 250 1 3/26/2012 125 1 3/24/2012 75 1 3/22/2012 250 1 3/26/2012 125 1 3/10/2012 500 2 3/11/2012 500 2 3/11/2012 50 2 3/15/2012 50 2 3/15/2012 95 2 3/22/2012 5000 2 3/22/2012 500 2 3/24/2012 550 2 3/24/2012 550 2 3/27/2012 95 2 3/27/2012 5000 3 3/15/2012 600 3 3/15/2012 25 3 3/22/2012 25 3 3/22/2012 125 3 3/23/2012 125 3 3/23/2012 600
  • 42. Window Partitioning and Ordering • OVER with PARTITION BY – Optionally groups the result set into multiple windows • OVER with ORDER BY – Specifies the row sequence in each window – Required for the ranking functions – Not previously supported for the aggregate functions • Now in SQL Server 2012 – OVER with ORDER BY now supported with aggregate functions – Window “framing” with ROWS and RANGE – Eight new analytic windowing functions
  • 44. New T-SQL Analytic Functions • FIRST_VALUE – Returns a column value from the first row of the window • LAST_VALUE – Returns a column value from the last row of the window • LAG – Returns a column value from a previous row of the window • LEAD – Returns a column value from a subsequent row of the window • PERCENT_RANK – Calculate percentile as (RANK – 1) / (N – 1) • CUME_DIST – Calculate percentile as RANK / N • PERCENTILE_DISC – Returns a discreet column value at the specified percentile • PERCENTILE_CONT – Returns a value based on the scale of column values at the specified percentile
  • 45. More New T-SQL Functions • Logical • Date/Time – CHOOSE – DATEFROMPARTS – IIF – TIMEFROMPARTS • String – DATETIME2FROMPARTS – CONCAT – DATETIMEOFFSETFROMPARTS – FORMAT – DATETIMEFROMPARTS • Conversion – SMALLDATETIMEFROMPARTS – TRY_CONVERT – EOMONTH – PARSE • Math – TRY_PARSE – LOG (changed)
  • 46. New SQL Server 2012 T-SQL Functions
  • 47. The THROW Statement • SQL Server 2005 added TRY/CATCH – Borrowed from .NET’s try/catch model – Vast improvement over repeatedly testing @@ERROR – Still used RAISERROR for generating errors • SQL Server 2012 adds THROW – Recommended alternative way to generate your own errors – Does not entirely replace RAISERROR • Two usages for THROW – With error code, description, and state parameters (like RAISERROR) – Inside a CATCH block with no parameters (re-throw)
  • 48. THROW vs. RAISERROR THROW RAISERROR Can only generate user exceptions Can generate user (>= 50000) and (unless re-throwing in CATCH block) system (< 50000) exceptions Supplies ad-hoc text; doesn’t utilize Requires user messages defined in sys.messages sys.messages (except for code 50000) Doesn’t support token substitutions Supports token substitutions Always uses severity level 16 (unless Can set any severity level re-throwing in a CATCH block) Can re-throw original exception caught Always generates a new exception; the in the TRY block original exception is lost to the client Error messages are buffered, and don’t Supports WITH NOWAIT to immediate appear in real-time flush buffered output on error
  • 49. THROW
  • 50. Server-Side Paging • New result paging keywords • Append to ORDER BY clause • Limits the number of rows returned • OFFSET @start ROWS • The first result row to return (zero-based) • FETCH NEXT @count ROWS – The number of rows to return
  • 52. Sequences • Sequential Number Generator – As found in Oracle and DB2 – Alternative to using IDENTITY for assigning new primary keys • Advantages over IDENTITY – SET IDENTITY INSERT ON/OFF not needed for inserts – Can obtain next sequence value without performing an insert • Create a Sequence Object CREATE SEQUENCE MySequence START WITH 1 INCREMENT 1 MINVALUE 1 NO MAXVALUE • Retrieve Sequence Values INSERT INTO MyTable(Id, ...) VALUES(NEXT VALUE FOR MySequence, ...)
  • 54. Metadata Discovery • New system stored procedures and data management views • sys.sp_describe_first_result_set – Analyzes a T-SQL statement and returns information describing the schema of the statement’s result set • sys.dm_exec_describe_first_result_set – Similar, but implemented as a table-valued function to support filtering • sys.dm_exec_describe_first_result_set_for_object – Similar, but accepts an OBJECT_ID of a T-SQL object in the database to be analyzed, rather than a T-SQL statement • sys.sp_describe_undeclared_parameters – Analyzes a T-SQL statement and returns information describing the parameter(s) required by the statement
  • 56. Contained Databases • Databases are not entirely self-contained – They have external instance-level dependencies – Logins, collations, tempdb, linked servers, endpoints, etc. • SQL Server 2012 provides partial containment – Makes databases more portable – Enables (but does not enforce) containment • Can store logins (with passwords) in the database – Users authenticate directly at the database level • sys.dm_db_contained_entities – Discovers threats to containment
  • 58. PART III BUSINESS INTELLIGENCE
  • 59. MICROSOFT’S BI STACK AND SQL SERVER’S ROLE IN IT
  • 60. Microsoft Business Intelligence Business User Experience Familiar User Experience Self-Service access & insight Data exploration & analysis Business Collaboration Predictive analysis Platform Data visualization Dashboards & Scorecards Business Collaboration Platform Contextual visualization Excel Services Databased forms & Web Infrastructure workflow and BI Platform Collaboration Analysis Services Search Reporting Services Information Platform Content Management Integration Services LOB data integration Master Data Services Data Mining Data Warehousing
  • 61. SQL Server 2008 BI Components
  • 62. But Wait, There’s More! • R2: PowerPivot • R2: Report Parts in SSRS • 2012: Analysis Services Tabular mode – And corresponding improvements in PowerPivot • 2012: Power View • 2012: Data Quality Services • How to get through it all? Here’s the menu…
  • 63. The Appetizer • Learn Data Warehousing/BI terms and concepts.
  • 64. The Main Course • Build a multidimensional cube – Query in Excel • Build a PowerPivot model – Query that from Excel too. – Publish to SharePoint • Upsize the PowerPivot model to SSAS tabular model – Add advanced features – Query from Excel • Analyze tabular model from Power View
  • 65. Dessert • Reporting Services – Report Builder and Report Parts • PerformancePoint Services • Overviews of – Data Quality Services – Master Data Services – StreamInsight
  • 68. Preparing For Business Intelligence Data • Transactions Warehouse • Process • Data • Relationships • Analysis Transaction Database
  • 69. Dimensional Model • Measure • Dimension • Hierarchy • Grain • Star Schema
  • 70. Star Schemas Country • Physical data model • Central fact table • Multiple dimension Shipper Year tables – Used to constrain fact table Total queries Sales Sales Product Person
  • 71. Example Data Request • Get Total Sales By State, By Month for a Calendar Year For Country = USA and Calendar Year = 1996
  • 73. Data Migration Data • Transactions Warehouse • Multi- • Process • Data dimensional • Relationships • Hierarchical • Analysis Transaction OLAP Database Database
  • 74. SQL Server Analysis Services • Built for analysis • It is free with SQL Server • And you can use the Microsoft stack that you know and love
  • 75. From Data Warehouse to OLAP Dimensions • Measure Dimension •Aggregations – Can have Hierarchies Fact Table • Cube Measures
  • 76. Building OLAP Cube With BIDS • Business Intelligence Development Studio – AKA Visual Studio • Business Intelligence Projects – Analysis Services Project Type Add Data Source Add Data Source View Add Cube Add Dimensions Add Measures Deploy the Cube
  • 78. Advanced OLAP • Calculated Members • Key Performance Indicators • Perspectives • And: – MDX – Actions – Partitions – Aggregations – Translations
  • 79. QUERYING CUBES FROM YOUR APPLICATIONS
  • 80. SSAS Interfaces C++ App VB App .NET App Any App OLEDB for OLAP/DM ADO/DSO ADOMD.NET AMO Any Platform, Any Device WAN XMLA XMLA Over TCP/IP Over HTTP Analysis Server (msmdsrv.exe) OLAP Data Mining Server ADOMD.NET DM Interfaces .NET Stored Procedures Microsoft Algorithms Third Party Algorithms
  • 83. Presenting Your Cube Excel Services PerformancePoint Services Reporting Services Excel SQL Server Oracle DB2 Tera- Data
  • 84. The SSAS/Excel/SharePoint Loop Build models with SSAS Multidim’l, Tabular or PowerPivot Visualize + Query from Analyze with Excel SSRS/ PivotTables and Excel Services/ PerformancePoint Charts Services OR Power View Publish to SharePoint (via Excel Services) and query in the browser
  • 86. PivotStuff • PivotTable, and linked charts (sometimes referred to as PivotCharts) work extremely well with OLAP cubes • How to create a PivotTable: – Ribbon’s Data tab (From Other Sources button/From Analysis Services option or Existing Connections button) – Insert tab (PivotTable “split button”) • How to insert a chart – PivotChart button on PivotTable Tools/Options tab – Several others
  • 88. Formula Language CUBE Functions • CUBEMEMBER and CUBEVALUE – Also CUBEKPIMEMBER, CUBEMEMBERPROPERTY, CUBERANKEDMEMBER, CUBESET and CUBESETCOUNT • IntelliSense style support – In a cell, type “=CU” and all CUBE formulas will display – Select one with arrow keys and hit Tab – When prompted for connection, type " and view pop-up list – Other pop-ups activate on " or "."
  • 89. At Your Service • “Range Drag” and relative formula support on CUBEVALUE • CUBEVALUE and Data Bars go great together • Ability to convert PivotTables to formulas
  • 92. Self-Service BI with PowerPivot • Excel + Analysis Services + SharePoint • Enables the working in Excel but mitigates the “spreadmart” pitfalls: – Use Analysis Services (AS) as a hidden engine Instead of no engine – Share via SharePoint, accessible by all AS clients Instead of “deploying” via email – Formal data refresh on server So data doesn’t get stale, and users don’t have to make effort at updating – Allow IT to monitor So it’s not all rogue – Provide path to more rigorous implementations Can be upsized to Analysis Services
  • 93. Column-Oriented Stores • Imagine, instead of: Employee ID Age Income 1 43 90000 2 38 100000 3 35 100000 • You have: Employee ID 1 2 3 Age 43 38 35 Income 90000 100000 100000 • Perf: values you wish to aggregate are adjacent • Efficiency: great compression from identical or nearly- identical values in proximity • Fast aggregation and high compression means huge volumes of data can be stored and processed, in RAM
  • 94. Data Import • Relational databases – SQL Server (including SQL Azure!), Access – Oracle, DB2, Sybase, Informix – Teradata – “Others” (OLE DB, including OLE DB provider for ODBC) • OData feeds, incl. R2/2012 Reporting Services, Azure DataMarket, WCF Data Services (Astoria), SharePoint 2010 lists, Visual Studio LightSwitch • Excel via clipboard, linked tables • Filter, preview, friendly names for tables/columns
  • 95. Calculated Columns and DAX • Formula-based columns may be created • Formula syntax is called DAX (Data Analysis eXpressions). – Not to be confused with MDX or DMX. Or DACs. • DAX expressions are similar to Excel formulas – Work with tables and columns; similar to, but distinct from, worksheets and their columns (and rows) • =FUNC('table name'[column name]) • =FUNCX('table name', <filter expression>) • FILTER(Resellers,[ProductLine] = "Mountain") • RELATED(Products[EnglishProductName]) • DAX expressions can be heavily nested
  • 96. Import data from almost anywhere PowerPivot Guidebook View data in Excel Calculated column entry Sort and filter DAX formula bar Relationship indicator Table tabs
  • 97. Data and What’s New? Diagram views KPIs Measures Measure grid Sort one column by another Measure formula
  • 98. Perspectives Default Aggregations Special Advanced Mode Diagram View Reporting properties Hierarchies Hide specific columns and tables Create relationships visually Measures KPIs
  • 100. Excel Services • A component of SharePoint Server 2007/2010; requires Enterprise CAL • Allows export of workbook, worksheet, or individual items to SharePoint report library – Works great for PivotTables and Charts! – Also for sheets with CUBExxx formulas or conditional formatting-driven “scorecards” • Content can be viewed in browser – Excel client not required – Drilldown interactivity maintained – Rendered in pure HTML and JavaScript – Parameterization supported
  • 101. PowerPivot Server • Publish to Excel Services • Viewing and interacting • Data Refresh • Treating as SSAS cube – 2008 R2 version: URL to .xlsx as server name – 2012 version: use POWERPIVOT named instance and treat just like SSAS Db name is GUID-based; best to discover it – Use Excel, Reporting Services as clients And now Power View too…more later
  • 102. The IT Dashboard Increase IT efficiency: Familiar Technologies for Authoring, Sharing, Security, and Compliance Customizable IT Dashboard Visualize usage with animated charts Simplify management of SSBI content using IT Operations Dashboard for SharePoint
  • 104. Analysis Services Tabular Mode • SSAS Tabular Mode is the enterprise/server implementation of PowerPivot • You must have a dedicated tabular mode SSAS instance • Tabular SSAS projects: BI Developer Studio (BIDS) gone PowerPivot – Implements equivalent tooling to PowerPivot Window – Can create an SSAS tabular database project by importing an Excel workbook with PowerPivot model • SSAS tabular models support partitions and roles
  • 105. SSAS Tabular Project in BIDS SSAS tabular project menus and toolbar Measure grid and formula bar Reporting properties in Properties window
  • 106. DirectQuery Mode • In DQ mode, model defines schema, but is not used for data • Queries issued directly against source • Similar to ROLAP storage for conventional cubes • Combine with xVelocity ColumnStore indexes for fast, real-time querying
  • 109. What is Power View? • Ad hoc reporting. Really! • Analysis, data exploration • Data Visualization • In Silverlight, in the browser, in SharePoint • Feels a little like Excel BI • Is actually based on SSRS – Power View makes a special RDL file
  • 110. Power View Data Sources • Power View works only against PowerPivot/SSAS tabular models – DirectQuery mode supported, however • For PowerPivot, click “Create Power View Report” button or option on workbook in SharePoint PowerPivot Gallery • For SSAS tabular model, create BISM data source, then click its “Create Power View Report” button or option – BISM data sources can point to PowerPivot workbooks too, if you want.
  • 111. In the browser, Power View! in Silverlight Ribbon, like Excel Variety of visualizations and data formats Field list, like Excel Data regions pane, like Excel
  • 112. View Modes Maximize one chart, fit report to window, put whole report in Reading Mode or Full Screen Create multiple pages (views)
  • 114. Constraining Your Data In Power View • Tiles – A filtering mechanism within a visualization • Highlighting – Selection in one visualization affects the others • Slicers – Similar to Excel against PowerPivot • True Filters – Checked drop-down list; very Excel-like – Right-hand filter pane, similar to SSRS and Excel Services
  • 116. Scatter/Bubble Charts • Allow for several measures • Features a “play” axis which can be manipulated through a slider or animated • Excellent way to visualize trends over time
  • 117. Multipliers • Multiple charts within a chart, in columns, rows, or a matrix – Horizontal and vertical multipliers • Allows for visualizing 1 or 2 additional dimensions
  • 118. Advanced Properties • Setting the representative column and image tells Power View how to summarize your data, and show stored images • Other properties tell it about key attributes, default aggregations and more • Reminder: “DirectQuery” mode tells Power View to get data from relational data source instead of columnar cache – Use with columnstore indexes to have the best of both worlds – columnstore indexes require Enterprise Edition, available in BI Edition
  • 120. Vocabulary • MOLAP: Multidimensional OLAP • UDM: Unified Dimensional Model • Cube: unit of schema in a dimensional database • xVelocity Columnstore Technology: PowerPivot/SSAS’ column store engine • VertiPaq: Old name for xVelocity • BISM: BI Semantic Model • IMBI: In-Memory BI engine • Tabular: a column store-based model – Because it uses tables, not cubes
  • 121. xVelocity Columnstore Indexes • Implementation of xVelocity columnar technology engine for SQL Server relational databases – Code name was: “Apollo” • Use it by creating a columnstore index – CREATE COLUMNSTORE INDEX index ON table (col1, Col2, …) • Can ignore it in a SELECT, too: – OPTION (IGNORE_NONCLUSTERED_COLUMNSTORE_INDEX) • Can significantly increase performance of star join queries (i.e. aggregating queries with dimension lookups). • Must enable “batch” mode as well – look @ query plan to confirm! • Not as good as SSAS, but better than plain old GROUP BY
  • 123. Scalable, Enterprise Reporting Platform • Author Impactful Reports • Powerful Designers • Flexible Report Layout • Rich Visualizations • Manage any Workload • Enterprise Scale Platform • Central Deployment • Strong Manageability • Deliver Personalized Reports • Interactive Reports • Rendering in the Format Users Want • Delivery to Location Users Want
  • 124. Self-Service Report Authoring Report Builder 3.0 Familiar Microsoft Office Interface Powerful Query Designer Powerful Wizards Flexible Layout Options w/ rich visualizations SharePoint list as data source PowerPivot as data source
  • 126. SSRS + SSAS = YES(S) • Reporting Services can query Analysis Services databases, including multidimensional cubes and tabular models, directly. PowerPivot too. • Uses MSOLAP OLE DB provider and issues MDX queries – Has its own query designer for MDX • Beware: SSRS essentially “flattens” SSAS data – Conforming multidimensional data to relational structures
  • 127. Self-Service Reporting? • Fact: Reporting Services is powerful • Fact: the data visualizations in SSRS are some of the best in the BI stack • Fact: None of that makes SSRS report design end-user-friendly • Building SSRS reports, and especially charts, gauges, etc. from scratch is tedious • Until now, best end-user option has been to copy an existing report and tweak it. Yech! • There must be a better way…
  • 128. Report Parts to the Rescue • Skilled SSRS designers can publish report parts – From Report Builder 3.0 or VS report projects • End users can pick them from a gallery – A task pane, in Report Builder 3.0, with search capability – Cannot select from VS report designer • What can be published?: – Tablixes (i.e. tables, matrices) – Rectangles – Images, Charts, Gauges, Maps – Parameters and Lists • All aided by new ability to share Datasets and original ability to share Data Sources
  • 129. Easy to Publish; Easy to Select
  • 132. PerformancePoint Services (PPS) Scorecards Analytics Cascading Multi-dimensional scorecards with slice and dice for interactive charts advanced analytics and data from including multiple sources decomposition tree, performance map, and perspective view
  • 133. PPS Capabilities • Analytic Grids & Charts – PPS’ own data visualizations – AJAX-based interactive analytics capabilities • Scorecards – Key Performance Indicators – Objectives – Dimensions • Dashboards – Bird’s eye view of business activities – Display Analytic Grids and Charts; Scorecards – Integrate SSRS, Excel Services (including PowerPivot) content – Add Filters
  • 135. MASTER DATA SERVICES, DATA QUALITY SERVICES AND STREAMINSIGHT
  • 136. MDS: Microsoft’s Master Data Management (MDM) tool • Examples: – Sales states, countries, currencies, customer types – Customers, products – Think of “lookup tables” or just think of dimensions! – Slowly changing non-transactional entities in your data • What gets stored: – Schemas – Any hierarchies – The data! • Other features: – Collections, business rules, security, workflows – Versioning
  • 137. Other Facts • Result of acquisition of Stratature • v1 is an ASP.NET application; UI is “different” • New in v2 (SQL Server 2012): • Now Silverlight-based; UI is still “different” • Excel add-in for data entry; creation of entities and attributes • Perform matching with DQS before loading • Includes .NET and Web Services APIs for reading/writing data and creating/editing models • Does not integrate with Analysis Services tools even though many of its features and concepts mirror those of dimension designer • Catalog kept in SQL Server database • Deployment packages can be created, shared and deployed
  • 138. Objects in MDS • Models – Entities (like tables or SSAS dimensions) Attributes (like columns/fields or SSAS attributes) Common attributes are Name and Code Attribute Groups Used to taxonomize attributes within tabs in UI Members (like rows/records or SSAS members) Hierarchies (like SSAS hierarchies) Derived or Explicit Collections (like SSAS named sets) – Versions – Business rules – Workflows
  • 139. Data Quality Services • Data Cleansing Tool • New to SQL Server 2012 • Result of Zoomix acquisition • Uses Artificial Intelligence algorithms to detect invalid data and perform matching (for de-duplication) • Allows manual intervention, too • Can integrate with MDS and SSIS • Cleaner data = better adoption of your BI project
  • 140. DQS Concepts • Knowledge Bases – Domains “semantic representation[s] of a type of data in a data field…[contain] a list of trusted values, invalid values, and erroneous data.” – Mapping • Data Quality Projects – Cleansing (i.e. correcting) Validate Using Reference Data Services and Azure DataMarket (or 3rd party providers) – Matching (i.e. de-duping) – Confidence – Profiling, Monitoring
  • 141. StreamInsight • Microsoft’s Complex Event Handling (CEP) Product • Processes data streams that are fast and high- volume • Highly parallel C++ code assures low latency, high throughput • Not based on SQL Server, though that is its “ship vehicle” • Interesting collaborative potential with BizTalk and SSIS
  • 142. StreamInsight Concepts • No UI. All interaction is programmatic. • Based on adapter architecture – Input and output adapters – Buy or build – Sensors, RFID readers, Web logs, market data streams are possible event sources • StreamInsight applications – Streams and events can be queried via LINQ from .NET – Server can run in-process, or shared
  • 143.
  • 144. StreamInsight v1.2: New in SQL Server 2012 • Resiliency: can take snapshots and restore to that saved state after an outage • Dev experience: LINQ enhancements – Multiple FROM clauses – Nested types • Extensibility: user-defined stream operators now supported • Admin features: server-wide and query- specific perf counters, Windows event logging • Included with Web and Standard Editions
  • 145. Hadoop on Windows • Hadoop is the open source implementation of Google’s MapReduce distributed processing engine • MS working with Hortonworks to implement it on Windows – A full “distro” – Window Server, Windows Azure DIY, Windows Azure self- serve cluster provisioning • Also: ODBC driver for Hive – Works with SSRS, SSAS Tabular, PowerPivot and plain Excel. • Also: JavaScript console in the browser • Come to my session on Thursday!
  • 146. PART IV BEYOND RELATIONAL
  • 148. The Need To Stream • Data explosion accelerating the creation and management of unstructured binary large objects (BLOBs) – Photos – Audio – Video – Email messages – Spreadsheets – Documents – Etc.
  • 149. BLOBs And The Database Two choices • Store them in the database • Store them outside the database, either in the file system or in a dedicated BLOB store BLOBs in the database • varbinary(max) column • Integrated management • Transactional • Simplified programming • Bloats the structured file groups
  • 150. BLOBs Inside The Database T-SQL CustomerId FirstName LastName Picture varbinary(max) 235 'John' 'Doe' 0x3B0E95AE3B2F02292F0B… 236 'Sally' 'Smith' 0xF3000EEF293039A2002C…
  • 151. BLOBs And The Database Two choices • Store them in the database • Store them outside the database, either in the file system or in a dedicated BLOB store BLOBs in the database BLOBs outside the database • varbinary(max) column • Path references to file system • Integrated management • Separate from the database • Transactional • Not transactional • Simplified programming • Complex programming • Bloats the structured file • Doesn’t interfere with groups performance
  • 152. BLOBs Outside The Database T-SQL File I/O CustomerId FirstName LastName Picture varchar(max) 235 'John' 'Doe' 'C:filesjdoe.jpg' 236 'Sally' 'Smith' 'C:filesssmith.jpg'
  • 153. BLOBs Using FILESTREAM • Transparently store varbinary(max) data in the file system – Declare column as “varbinary(max) FILESTREAM” • Integrated management – BLOBs are logically part of the database (backup, restore, etc.), but stored physically separate as a file group mapped to the file system • Simplified programming – SQL Server transparently links rows in relational tables to BLOBs in the file system – No developer effort required to maintain references between structured and unstructured data • Transactional – SQL Server integrates with the NTFS file system – Database transactions wrap NTFS transactions • Performant – File system is optimized for streaming
  • 154. BLOBs Using FILESTREAM T-SQL CustomerId FirstName LastName Picture varbinary(max) FILESTREAM 235 'John' 'Doe' 0x3B0E95AE3B2F02292F0B… 236 'Sally' 'Smith' 0xF3000EEF293039A2002C…
  • 155. Enabling the Service for FILESTREAM • Security concern of the Windows administrator • Set to one of four levels – Disabled – T-SQL only – T-SQL + file system (local only) – T-SQL + file system (remote) • Enable it either: – During setup – With SQL Server Configuration Manager – No way to script with T-SQL, but VBScript file is available on CodePlex that provides command-line alternative
  • 156. Enabling the Instance for FILESTREAM • Security concern of the SQL Server administrator – Windows and SQL admins must agree!  • Set to one of three levels – Disabled, T-SQL only, T-SQL + file system • Enable it either: – In SSMS Server Properties dialog – In T-SQL, with: EXEC sp_configure filestream_access_level, n RECONFIGURE
  • 157. Creating a FILESTREAM Database • CREATE DATABASE PhotoLibrary ON PRIMARY (NAME = PhotoLibrary_data, FILENAME = 'C:DBPhotoLibrary_data.mdf'), FILEGROUP FileStreamGroup1 CONTAINS FILESTREAM (NAME = PhotoLibrary_group2, FILENAME = 'C:DBPhotos') LOG ON (NAME = PhotoLibrary_log, FILENAME = 'C:DBPhotoLibrary_log.ldf')
  • 158. Creating a FILESTREAM Database • CREATE DATABASE PhotoLibrary ON PRIMARY (NAME = PhotoLibrary_data, FILENAME = 'C:DBPhotoLibrary_data.mdf'), FILEGROUP FileStreamGroup1 CONTAINS FILESTREAM (NAME = PhotoLibrary_group2, FILENAME = 'C:DBPhotos') LOG ON (NAME = PhotoLibrary_log, FILENAME = 'C:DBPhotoLibrary_log.ldf')
  • 159. Creating FILESTREAM Columns • Table requires ROWGUIDCOL column – Attribute applied to a uniqueidentifier (GUID) column – Must be primary key or have unique constraint – Only one ROWGUIDCOL column is permitted per table • Define BLOB columns as “varbinary(max) FILESTREAM” – Any number of BLOB columns are permitted per table
  • 161. Introducing SqlFileStream • It is not easy, practical, or efficient to manipulate BLOBs in T-SQL • Build a streaming client with SqlFileStream – System.Data.SqlTypes.SqlFileStream – Part of System.Data.dll in .NET 3.5 SP1 and higher – Inherits from Stream – Constructor takes logical path and transaction context – Wraps OpenSqlFilestream SQL Server native client API – Consumes no SQL Server memory during processing
  • 162. The SqlFileStream Recipe • Begin Transaction • INSERT/SELECT row • Retrieve BLOB PathName() • Retrieve GET_FILESTREAM_TRANSACTION_CONTEXT() • Create and use SqlFileStream • Commit Transaction
  • 163. BLOBs Using SqlFileStream T-SQL SqlFileStream CustomerId FirstName LastName Picture varbinary(max) FILESTREAM 235 'John' 'Doe' 0x3B0E95AE3B2F020B… 236 'Sally' 'Smith' 0xF3000EEF293039A2…
  • 165. FILESTREAM Limitations & Considerations • Mirroring/HADR – Not supported with mirroring – Supported with HADR (SQL Server 2012 “AlwaysOn”) • Transparent Data Encryption (TDE) – Does not encrypt files • Replication – Supported with some restrictions, see BOL • Log Shipping – Fully supported – Primary and secondary servers require SQL Server 2008 or higher • Full-Text Search (FTS) – Fully supported
  • 166. FILESTREAM Limitations & Considerations (cont.) • Database Snapshots – Not supported for FILESTREAM filegroups • Snapshot Isolation Level – Wasn’t supported in SQL Server 2008, supported in 2008 R2 and 2012 • Local NTFS File System – Requires local NTFS file system – RBS (Remote BLOB Store) API makes SQL Server act as a dedicated BLOB store • Security – Requires mixed-mode (integrated) security • SQL Server Express Edition – Fully supported – Database size limit (4GB in SQL Server 2008, 10GB in 2008 R2 and 2012) does not include FILESTREAM data
  • 168. Hierarchical Data Is Not Relational • Today’s most common form of hierarchical data is XML • XML support added in SQL Server 2005 is great, if: – You want to store and retrieve an entire hierarchy at one time – The data is consumed in XML by client applications • Parent-child relationships define rigid hierarchies – Can’t support unlimited breadth and depth
  • 169. Hierarchical Storage Scenarios • Forum and mailing list threads • Business organization charts • Content management • Product categories • File/folder management • FileTable in SQL Server 2012 • Many more… – All typically iterated recursively
  • 170. Traditional Self-Join Approach • One table – Each row is linked to its parent • Works, but has limitations – CTEs help with recursive queries – Still your job to manage updates – Manually maintain structure – Complex to reparent entire sub-trees – Difficult to query – Difficult to control precise ordering of siblings
  • 171. Introducing hierarchyid • System CLR data type – Extremely compact variable-length format – Does not require SQL CLR to be enabled on the server • Enables a robust hierarchical structure over a self-joining table – Each row is a node with a unique hierarchyid value – Contains the path in the hierarchy to the node… down to the sibling ordinal position • Invoke methods in T-SQL – Efficiently query the hierarchy – Arbitrarily insert, modify, and delete nodes – Reparent entire sub-trees with a single update
  • 172. hierarchyid Methods • GetAncestor • GetDescendant • GetLevel • GetReparentedValue • GetRoot • IsDescendantOf • Parse • ToString
  • 173. Indexing hierarchyid Columns • Two types of indexes: Depth-First Index – Use one, the other, or both as your needs dictate • Depth-First – Create a primary key or unique index Breadth-First Index • Breadth-First – Create a composite index that includes a level column
  • 177. Introducing FileTable • Builds on FILESTREAM and hierarchyid • A “semi”-ordinary table that houses a logical file system – Fixed column schema – Each row represents a “folder” or “file” Column Name Data Type Description stream_id uniqueidentifier Unique row identifier ROWGUIDCOL file_stream varbinary(max) BLOB content (NULL if directory) FILESTREAM name nvarchar(255) Name of file or directory path_locator hierarchyid Location of file or directory within the file system hierarchy – Plus 10 storage attributes columns (e.g., is directory, created, modified, archive bit) • Windows file/directory management API support – A Windows file share exposes the FileTable – Bi-directional – changes to the table are reflected in the file share and vice versa
  • 178. BLOBs Using FileTable hierarchyid column varbinary(max) Name Database Rows FileTable Name Server Machine Instance Name defines logical file Name FILESTREAM column FILESTREAM Share and folder paths contents holds each file’s T-SQL T-SQL SqlFileStream stream_id name path_locator file_stream 27D8D4AD-D100-39… 'Financials' 0xFF271A3562… NULL 78F603CC-0460-73… 'ReadMe.docx' 0xFF59345688… 0x3B0E956636AE3B2F020B… 207D4A96-E854-01… 'Budget.xlsx' 0xFD0011039A… 0xF3F359000EEF293039A2…
  • 179. FileTable Prerequisites • Prerequisites at the instance level – FILESTREAM must be enabled for the instance • Prerequisites at the database level – Enable non-transactional FILESTREAM access for the database (is still transactional internally) – Set a root directory name for all FileTables in the database (this will become a child in the Windows file share) – Use this T-SQL statement: CREATE DATABASE … WITH – or – ALTER DATABASE … SET – …followed by… FILESTREAM( NON_TRANSACTED_ACCESS=FULL|READ, DIRECTORY_NAME='DatabaseRootDirectory')
  • 180. Creating a FileTable • Create a FileTable in T-SQL – CREATE TABLE TableName AS FileTable • FileTable has a fixed schema – You don’t (can’t) supply a column list • Creates logical directory – Logical root directory for the FileTable – Created beneath the root directory for the database – Named after the table, can override by specifying: WITH(FileTable_Directory='TableRootDirectory') – Exposes a functional Win32 file system – Does not support memory-mapped files (does not affect remote clients)
  • 182. SQL Server Spaces Out • Integrate location awareness into any application – Long been the domain of sophisticated GIS applications • GIS – A system for capturing, storing, analyzing, and managing data and associated attributes which are spatially referenced to the earth • Allow a user to interact with information that is relevant to locations that they care about: – Home, work, school, or vacation destinations • Two geospatial models – Planar – Geodetic
  • 183. Spatial Data Types • Two spatial models = Two system CLR types • geometry – Planar (flat) model – Flat 2-dimensional Cartesian Coordinate system – X and Y coordinates with uniform units of measure – Use for mapping small areas • geography – Geodetic (round-earth) model – Latitude and longitude – Use for larger mapping where land mass is too big to fit on one planar projection
  • 184. Planar Spatial Model • Two-Dimensional Surface – X and Y coordinates on an arbitrary plane • Flat Earth Projection – To work with geospatial data on a 2D surface, a projection is created to flatten the geographical objects on the spheroid – Example: Planar Model based on Mercator Projection Greenland Square KM: North - Antarctica = 13 million America - Greenland = 2 million Africa - N. America = 24 million - Africa = 30 million Antarctica
  • 185. Geodetic Spatial Model • Accurate geographic measurements – Locations on planet surface described by latitude and longitude angles • Ellipsoidal sphere – Latitude = angle N/S of the equator – Longitude = angle E/W of the Prime Meridian
  • 186. Spatial Data Standards • Open Geospatial Consortium (OGC) – International standards body • Microsoft belongs to the OGC – SQL Server 2008 uses the OGC’s Simple Feature Access standards • OpenGIS Simple Feature Interface Standards (SFS) – A well-defined way for applications to store and access spatial data in relational databases – Described using vector elements; such as points, lines and polygons • Three ways to import geospatial data – Well-Known Text (WKT) – Well-Known Binary (WKB) – Geographic Markup Language (GML)
  • 187. Well-Known Text (WKT) • WKT examples: • POINT(6 10) • POINT(-111.06687 45.01188) • LINESTRING(3 4,10 50,20 25) • POLYGON((1 1,5 1,5 5,1 5,1 1),(2 2, 3 2, 3 3, 2 3,2 2)) • POLYGON(( -75.17031 39.95601, -75.16786 39.95778, -75.17921 39.96874, -75.18441 39.96512, -75.17031 39.95601)) • MULTIPOINT(3.5 5.6,4.8 10.5) • MULTILINESTRING((3 4,10 50,20 25),(-5 -8,-10 -8,-15 -4)) • GEOMETRYCOLLECTION(POINT(4 6),LINESTRING(4 6,7 10)) • CIRCULARSTRING(1 5, 6 2, 7 3)
  • 188. Geospatial Methods • STArea • STBuffer • STCentroid • STDifference • STDimension • STDistance • STEnvelope • STGeomFromText • STIntersection • STIntersects • STPointFromText, STLineFromText, STPolyFromText • STPointFromWKB, STLineFromWKB, STPolyFromWKB • STSymDifference • STUnion • GeomFromGml • Parse • ToString • and more (about 70 total)
  • 190. 0,0 150,0 300,0 50,50 100,100 0,150 150,150 300,150 20,180 180,180 150,300 300,300
  • 191.
  • 192. Spatial Improvements In SQL Server 2012 • Circular Arcs • CircularString • CompoundCurve • CurvePolygon • All existing methods work on circular objects • New spatial methods • BufferWithCurves • STNumCurves, STCurveN • STCurveToLine • CurveToLineWithTolerance • IsValidDetailed • HasZ, HasM, AsBinaryZM • ShortestLineTo • UnionAggregate, EnvelopeAggregate, CollectionAggregate, ConvexHullAggregate • MinDbCompatibilityLevel
  • 193. Spatial Improvements In SQL Server 2012 • Improved Precision • Constructions and relations use 48 bits of precision (previously 27 bits) • geography Enhancements • Support for objects larger than a logical hemisphere (“FullGlobe”) • Support for new and previous “geometry-only” methods • New SRID • Spatial reference ID 104001 (sphere of radius 1) • Performance Improvements • Better tuning and hints • Auto Grid indexing with 8 levels (previously 4 levels) • Other Improvements • New histogram stored procedures • Support for persisted computed columns
  • 194. Resources • Workshop slides and code – http://sdrv.ms/VSLiveNY2012SQL • Aaron Bertrand’s Blog – http://sqlblog.com/blogs/aaron_bertrand • Bob Beauchemin’s Blog – http://sqlskills.com/BLOGS/BOBB • Itzik Ben-Gan’s Web Site – http://www.sql.co.il • James Serra’s Blog – http://www.jamesserra.com • simple-talk – Learn SQL Server – http://www.simple-talk.com/sql/learn-sql-server
  • 195. Thank You! • Contact us – andrew.brust@bluebadgeinsights.com – lenni.lobel@sleektech.com • Visit our blogs – brustblog.com – lennilobel.wordpress.com • Follow us on Twitter – @andrewbrust – @lennilobel • Thanks for coming! 