One of the most important factors to be successful as a developer is being up to date in knowledge and unlearning old outdated stuff and learning new stuff. This is very essential whenever there is a new release of a product that we are working in. Here is an attempt to learn together the new features of SQL 2012.
1. New features of SQL
2012
Sathyan R
sathyanr@mindfiresolutions.com
ALL SAMPLES FROM ADVENTUREWORKS2012 DB
2. Agenda
- Shortcuts
- New DMVs
- Spatial Indexes
- Columstore Indexes
- String Functions
- DateTime Functions
- Conversion Functions
- Offset and Fetch
- Sequence
- With Result Sets
- Error Handling Enhancements
- Filetable
- Analytical Functions
- Questions posed by Big Data
3. Shortcuts
Keyboard Shortcuts
Query Shortcuts
Formatting Shortcuts
Auto Recover (Old)
Visual Studio Compatible
Full List
4. New DMVs
Server state information that can be used to
monitor the health of a server instance,
diagnose problems, and tune performance.
Multiple Types (DB, Extended Events,
Execution, Mirroring, CLR, Index, I/O, Security,
Etc.)
New Additions in 2012
Select *
5. Spatial Indexes
Faster build time for spatial indexes on point
data – critical for tables with millions of rows
Optimized STDistance and STBuffer Functions
Row Compression and Page Compression
sp_help_spatial_geography_histogram
sp_help_spatial_geometry_histogram
More Details
6. Columnstore Indexes
Star Schema - Fact table – Dimension Table
Row Based Storage
Columnstore Indexes – Performance
Improvement
Syntax
Restrictions – Insert/Update
Data type restrictions
Clustered Columnstore Index?
7. String Functions
CONCAT
◦Auto Handles NULL
FORMAT
◦Addresses Issues in DateTime Formatting
◦Culture specific same as in .NET
◦FORMAT ( value, format [, culture ] )
8. DATETIME Functions
EOMONTH
DATEFROMPARTS
◦Sample, Format Date
DATETIME2FROMPARTS
TIMEFROMPARTS
DATETIMEFROMPARTS
DATETIMEOFFSETFROMPARTS
12. SEQUENCE
Identity
SEQUENCE - at DB level - used across
multiple tables – Controlled by App
SEQUENCE can be reset without altering
its previous value – MIN – MAX - CYCLE
13. SEQUENCE USAGE - MSDN
The application requires a number before the insert into the table is made.
The application requires sharing a single series of numbers between multiple
tables or multiple columns within a table.
The application must restart the number series when a specified number is
reached. For example, after assigning values 1 through 10, the application starts
assigning values 1 through 10 again.
The application requires sequence values to be sorted by another field. The NEXT
VALUE FOR function can apply the OVER clause to the function call. The OVER
clause guarantees that the values returned are generated in the order of the
OVER clause's ORDER BY clause.
An application requires multiple numbers to be assigned at the same time. For
example, an application needs to reserve five sequential numbers. Requesting
identity values could result in gaps in the series if other processes were
simultaneously issued numbers. Calling sp_sequence_get_range can retrieve
several numbers in the sequence at once.
You need to change the specification of the sequence, such as the increment
value.
14. WITH RESULT SETS
change the column names and data types
of the result set returned in the execution
of a SP
15. Error Handling With Throw
Much Easier, Simpler
Similar to .NET
No need of @@RAISE_ERROR Anymore
18. Questions Posed by BigData
Velocity Volume Variability
Hadoop - DFS
Facebook Twitter Google
Two different reasons
SSD – Solid State Data Storage allows
100,000s IOPS Vs 150 to 200
Hortonworks and Cloudera