skip to main |
skip to sidebar
SQL 2008 – TSQL Enhancements
SQL 2008 – TSQL Enhancements Agenda - Platform changes
- XML Enhancements
- Compound Operators
- Row Constructors
- MERGE keyword
- Table Valued Parameters
- Sparse Columns
- Date Time enhancements
- Filestream
- Spatial data
- Hierarchy Data Type
Platform Changes (Justin’s top 8) - Database Mirroring enhancements
- Policy Based Management
- Auditing
- Data Compression
- BACKUP Compression
- Powershell Integration
- Transparent Database Encryption
- Change tracking on databases
XML Enhancements Compound Operators - Can now declare and initialize variables in the same statement
- +=
- -=
- /=
- *=
- %=
Row Constructors - Values clause returns relational table with multiple rows
- Use with INSERT statement to insert multiple rows as an atomic operation;
Change Tracking - Version of the data
- Most commonly used for entity data models
MERGE Keyword - UPSERT
- Atomic statement combining INSERT, UPDATE and DELETE operations based on conditional logic
- Set-based operation; more efficient than multiple separate operations
- MERGE is defined by ANSI SQL; you will find it in other database platforms as well e.g. Oracle
- Useful in both OLTP and Data Warehouse environments
- OLTP: merging recent info from external source
- DW: incremental updates of fact, slowly changing dimensions
Table Valued Parameters - CREATE TYPE [typeName] AS TABLE
- Great for passing in table parameters to a stored proc
- Strongly type variables
- Helps address the need to pass array elements to stored proc/functions
Sparse Columns - Ordinary Columns optimised for NULL values
- No space used unless data added (4 byes extra if you do use)
- Behaves the same for end user
Date Time enhancements - New date and time types!
- DATE – ANSI compliant
- TIME – ANSI compliant
- DATETIMEOFFSET – TZ aware DateTime
- DATETIME2 – DateTime with variable precision and larger range support
Filestream - Stores binary files on file system
- Can’t use with MIRROR-ed databases
- Varbinary(max) – gets over 2GB limit
- Not accessible by files only by SQL Server
- Reduce size of database and backups
Spatial Data - Two new system CLR data types
- GEOMETRY
- GEOGRAPHY
Hierarchy Data Type - New system CLR type supporting trees
- Internally stored as Varbinary <= 900 bytes
- Holds a path that provides…
Resources - Books Online
- TechEd DVD’s
- PDC Videos
- MSDN Webcasts
- Greg Low SQL Downunder podcast
No comments:
Post a Comment