Archive
SQL Server 2016 RC0, first Release Candidate is available for download
Microsoft (on 7-March-2015) announced the first SQL Server 2016 release candidate, SQL Server 2016 Release Candidate (RC) 0. With this release SQL Server adds rich set of capabilities, including Real-time Operational Analytics, rich Visualizations on mobile devices, built-in Advanced Analytics, new advanced Security technologies, and new Hybrid scenarios allowing you to securely Stretch data to the cloud.
[Register and Download the CTP 3.3 Evaluation version (180 days) here]
–> Direct download link (~2.6 GB):
– Download the single ISO: SQLServer2016RC0-x64-ENU.iso
– Or download both EXE & BOX files:
– Box file SQLServer2016-x64-ENU.box
– EXE file SQLServer2016-x64-ENU.exe
– Download SSMS: SSMS-Full-Setup.exe
–> Check version and SQL build:
select @@version
Microsoft SQL Server 2016 (RC0) – 13.0.1100.288 (X64)
Feb 29 2016 23:19:56
Copyright (c) Microsoft Corporation
Enterprise Evaluation Edition (64-bit) on Windows 10 Enterprise 6.3 (Build 10586: )
Please Note: Management Studio (SSMS) is no longer bundled with the ISO or CAB files, and will need to be installed separately, link mentioned above for RC0.
–> The RC 0 has some awesome new features:
1. Database scoped configuration: a new database level object that holds optional configuration values that affect the behavior of the application code at the database level. This statement modifies the default SQL Server 2016 Database Engine behavior for a particular database. A generic mechanism for creating database configuration(s) at creation time is not provided. These options are:
– Clear procedure cache.
– Set the MAXDOP parameter to an arbitrary value (1,2, …) for the primary database based on what works best for that particular database and set a different value (e.g. 0) for all secondary database used (e.g. for reporting queries).
– Set the query optimizer cardinality estimation model independent of the database to compatibility level.
– Enable or disable parameter sniffing at the database level.
– Enable or disable query optimization hotfixes at the database level.
2. PolyBase enhancements includes support for:
– The latest Cloudera distribution CDH5.5 on Linux.
– Public containers and blobs in Azure blob storage.
3. In-Memory OLTP enhancements includes:
– Parallel scan of non-clustered indexes.
– Reduced downtime during upgrade.
– Built-in function @@SPID is now supported natively compiled T-SQL modules and in constraints on memory-optimized tables
– Log-optimized and parallel ALTER (ALTER TABLE operations now run in parallel).
4. STRING_SPLIT() and STRING_ESCAPE() function, new in-built Table-Valued Functions:
– STRING_SPLIT, Splits input character expression by specified separator and outputs result as a table.
– STRING_ESCAPE, Escapes special characters in texts and returns text with escaped characters.
5. Support for UTF-8 data to export and import.
– Data stored in a UTF-8 encoded file can now be imported into SQL Server and exported from SQL Server into a UTF-8 encoded file, using BCP utility, BULK INSERT and OPENROWSET.
6. JSON_MODIFY() new function:
– To update the value of a property in a JSON string and return the updated JSON string.
7. Stretch Database enhancements:
– New version of Stretch Database on Azure that supports 60 TB of data
– Azure Active Directory authentication, The option to use a federated service account for SQL Server to communicate with the remote Azure SQL Database server when certain conditions are true no longer requires a trace flag.
8. ColumnStore Index enhancements:
– Compression delay. This new option minimizes the impact of the transactional workload on real-time operational analytics.
– GROUP BY performance enhancement, aggregate pushdown for GROUP BY clause when run against a nonclustered columnstore index.
– New alter table option, now you can create a columnstore index on an existing memory-optimized table.
9. SQL Server Management Tools (SSMS): SQL Server Management Tools is no longer installed from the main feature tree, as mentioned above.
–> Few more enhancements in other areas:
1. AlwaysOn Availability Groups add support for:
– Distributed Availability Groups.
– Streaming seeding of replicas.
2. SSAS (Analysis Services) add support for :
– Display folders in Analysis Services.
– PowerShell support for Tabular models.
– SSIS support for Tabular models.
– Tabular Object model for Tabular models.
– more at Analysis Services blog.
3. SSRS (Reporting Services) support for:
– Subscribe to reports to receive them in your email inbox, download, rename, move, and delete reports and other catalog items.
– Manage shared datasets.
– Manage data caching and refresh.
– Create “linked” reports with different default parameter values.
– Pin to a dashboard in a group when pinning a report chart, gauge, map, or image to a Power BI dashboard.
– Choose the currency for monetary values when creating a KPI or mobile report.
– more at Reporting Services blog.
4. SQL Server Integration Services (SSIS)
– SSIS Projects in Visual Studio SQL Server Data Tools (SSDT) can now target 2012, 2014 and 2016 versions of SQL Server by switching a project level property between 2012, 2014 and 2016 SQL server.
– SSIS now supports setting a server wide customized logging level.
– The SSIS HDFS connector now supports the ORC file format, in addition to CSV and Avro.
– more at Integration Services blog.
I’ve covered very few and important points here, you can check all the updates here in [SQL Server blog for RC 0] with details.
For all these new features released in SQL Server 2016, check my blog posts here.
So, download the Preview today and start playing with the new features and plan your DB migration/upgrade.
SQL Server 2016 CTP 3.3 update is here | download now
Microsoft (on 4-Feb-2015) announced the CTP 3.3 update of the recently and initially released Community Technology Preview (CTP) 2.x & 3.0 versions of SQL Server 2016.
[Register and Download the CTP 3.3 Evaluation version (180 days) here]
–> Direct download link (~2.6 GB):
– Download the single ISO: SQLServer2016CTP3.3-x64-ENU.iso
– Or download both EXE & BOX files:
– Box file SQLServer2016-x64-ENU.box
– EXE file SQLServer2016-x64-ENU.exe
–> Check version and SQL build:
select @@version
Microsoft SQL Server 2016 (CTP3.3) – 13.0.1000.281 (X64) Jan 28 2016 15:11:40 Copyright (c) Microsoft Corporation Enterprise Evaluation Edition (64-bit) on Windows 10 Enterprise 6.3 (Build 10586: )
–> This CTP 3.3 release has major enhancements on:
1. Stretch Database improvement includes:
– Alter and drop index support for stretch tables.
– Add, alter and drop columns support for stretch tables.
– Query performance improvement.
– Azure Stretch database edition preview with support for up to 60TB
– Point-in-time restore and geo-failover support.
– Improved SSMS visualization with StretchDB icons.
– Added support for stretching using federated accounts in SSMS.
2. In-Memory OLTP enhancements, which dramatically improves transaction processing performance.
– Automatic update of statistics on memory-optimized tables
– Sampled statistics for memory-optimized tables
– Use of LOB types varchar(max), nvarchar(max), and varbinary(max) with built-in string functions (‘+’, len, ltrim, rtrim and substring) in natively compiled modules, and as return type of natively compiled scalar UDFs.
– Support also larger rows using types varchar(n), nvarchar(n) and varbinary(n)
– OUTPUT clause can now be used with INSERT, UPDATE and DELETE statements in natively compiled stored procedures.
3. Foreign Key enhancements , increased the number of supported incoming foreign key REFERENCES to a table:
– Till SQL Server 2014 the recommended maximum was 253, now the new maximum is 10,000 references, while maintaining good performance for DML operations in both the referencing and the referenced table.
4. Autostats enhancements, Previously, statistics were automatically recalculated when the change exceeded a fixed threshold.
– Now the algorithm is refined such that it is no longer a fixed threshold, but in general will be more aggressive in triggering statistics scans, resulting in more accurate query plans.
–> Few more enhancements in other areas:
1. SSAS (Analysis Services) DirectQuery models, Tabular Models running in DirectQuery mode now also allows:
– DAX filters when defining roles and creation of calculated columns.
– Apply row level security to a DirectQuery model.
– Translating your tabular model into different languages to be consumed by any client tool connecting to SSAS.
– and many more, [check here].
2. SSRS (Reporting Services) web portal, updated preview of the new web portal now enables you to:
– add the KPIs and reports you use to your Favorites, to create and edit shared data sources for your KPIs and reports, and to perform other management tasks.
– access the reports you need on your Favorites page – without the clutter.
– and many more, [check here].
3. SQL Server Management Studio (SSMS) Jan 2016 Release, [check here].
I’ve covered very few and important points here, you can check all the updates here in [SQL Server blog for CTP 3.3] with details.
For all these new features released in SQL Server 2016, check my blog posts here.
So, download the Preview today and start playing with the new features and plan your DB migration/upgrade.
Implementing “Row Level Security” (RLS) with “Block Predicates” in SQL Server 2016 – Part 2
In my [previous post] I discussed about Row Level Security, its introduction, and a detailed demo on how to implement it.
There I discussed about the Filter Predicate option available in the CTP 2.x release. With this option we can restrict read access for a user to avoid unauthorized access of rows.
Filter Predicates filters the read operations like SELECT, UPDATE and DELETE, but do not filter INSERT operations, and thus a user can INSERT any row (associate to another user also).
Here in this post I will talk about the new Block Predicate option available in the CTP 3.0 release. With this option we can restrict write access for specific users.
Block Predicates block all write operations like:
– AFTER INSERT and AFTER UPDATE
– BEFORE UPDATE
– and BEFORE DELETE
To know more about these write operations check MS BoL here.
I’m using the same script I used in my [previous post] about RLS with Filter Predicates.
–> Step #1. Create some test accounts and test data:
-- Let's create some test accounts:
-- Three users for The CEO, HR & Finance department admin users.
CREATE USER userCEO WITHOUT LOGIN;
GO
CREATE USER userHR WITHOUT LOGIN;
GO
CREATE USER userFin WITHOUT LOGIN;
GO
CREATE USER userAdmin WITHOUT LOGIN;
GO
-- Create a sample table [dbo].[Employee]: with a self-referencing Manager ID column.
CREATE TABLE dbo.Employee (
[EmpCode] NVARCHAR(50), -- Employee ID
[EmpName] NVARCHAR(250), -- Employee/Manager Full Name
[Salary] MONEY, -- Fictious Salary
[MgrCode] NVARCHAR(50) -- Manager ID
);
GO
-- Now insert some test records:
-- Top Boss CEO
INSERT INTO dbo.Employee VALUES ('userCEO' , 'CEO Top Boss' , 800, NULL)
-- Next 2 levels under CEO
INSERT INTO dbo.Employee VALUES ('userHR' , 'HR User' , 700, 'userCEO');
INSERT INTO dbo.Employee VALUES ('userFin' , 'Finance User' , 600, 'userCEO');
-- Employees under Kevin
INSERT INTO dbo.Employee VALUES ('manojp' , 'Manoj Pandey' , 100, 'userHR');
INSERT INTO dbo.Employee VALUES ('saurabhs', 'Saurabh Sharma', 400, 'userHR');
INSERT INTO dbo.Employee VALUES ('deepakb' , 'Deepak Biswal' , 500, 'userHR');
-- Employees under Amy
INSERT INTO dbo.Employee VALUES ('keshavk' , 'Keshav K' , 200, 'userFin');
INSERT INTO dbo.Employee VALUES ('viveks' , 'Vivek S' , 300, 'userFin');
GO
-- Let's check the records before applying "Row Level Security":
SELECT * FROM dbo.Employee; -- 8 rows
GO
Output: As a normal SEELCT and without RLS, it just ignores my Execution Context and execute the Query and return all the 8 rows.
–> Step #2. Grant only SELECT to the CEO-User, and Grant SELECT, INSERT,UPDATE, DELETE access on the dbo.Employee table to all 3 users:
GRANT SELECT ON dbo.Employee TO userCEO; GO GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.Employee TO userHR; GO GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.Employee TO userFin; GO GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.Employee TO userAdmin; GO
The new “Row Level Security” feature lets you:
– apply this security at the database level
– create two predicate functions, Filter & Block Predicates.
– and there is no need to apply the WHERE clause to filter out unauthorized users.
–> Step #3a. Create an Inline Table-Valued Function to create a Filter Predicate function:
CREATE FUNCTION dbo.fn_SecurityFilterPredicateEmployee (@mgrCode AS sysname)
RETURNS TABLE
WITH SCHEMABINDING
AS
RETURN SELECT 1 AS fn_SecurityPredicateEmployee_result
-- Predicate logic
WHERE @mgrCode = USER_NAME()
OR USER_NAME() IN ('userCEO', 'userAdmin'); -- the CEO and Admin should see all rows
GO
–> Step #3b. Create an Inline Table-Valued Function to create a Block Predicate function:
CREATE FUNCTION dbo.fn_SecurityBlockPredicateEmployee (@mgrCode AS sysname)
RETURNS TABLE
WITH SCHEMABINDING
AS
RETURN SELECT 1 AS fn_SecurityPredicateEmployee_result
-- Predicate logic
WHERE @mgrCode = USER_NAME()
OR USER_NAME() = 'userAdmin'; -- the Admin should have SELECT, INSERT, UPDATE, DELETE access to all rows
GO
Both the functions returns value 1 when a row in the MgrCode (Manager ID) column is the same as the user executing the query (@@mgrCode = USER_NAME()) or if the user executing the query is the Top Boss user USER_NAME() IN (‘userCEO’, ‘userAdmin’) and (USER_NAME() = ‘userCEO’) respectively.
–> Step #4. Create a security policy adding both the functions for Filter & Block predicates:
CREATE SECURITY POLICY ManagerFilter ADD FILTER PREDICATE dbo.fn_SecurityFilterPredicateEmployee(MgrCode) ON dbo.Employee, ADD BLOCK PREDICATE dbo.fn_SecurityBlockPredicateEmployee(MgrCode) ON dbo.Employee WITH (STATE = ON); -- The state must be set to ON to enable the policy. GO -- Now let's again check the records after applying "Row Level Security": SELECT * FROM dbo.Employee; -- 0 rows, because my used does not have any access. GO
Finally with the above 4 steps we’ve configured RLS with both Filter & Block predicates, to restrict unauthorized access and modification of data.
Note: to check and validate RLS with Filter Predicate while retrieving data (or SELECT) please refer my [previous post].
–> Now, let’s check and validate RLS with Block Predicate while Updating data (INSERT, UPDATE, DELETE):
Usage #1. First we will check our top boss ‘userCEO’ account which has just read/SELECT access:
EXECUTE AS USER = 'userCEO';
SELECT * FROM dbo.Employee; -- 8 rows
-- 1. Insert:
INSERT INTO dbo.Employee (EmpCode, EmpName, Salary, MgrCode)
VALUES ('akashm' , 'Akash M' , 550, 'userCEO') -- error
/*
Msg 229, Level 14, State 5, Line 106
The INSERT permission was denied on the object 'Employee', database 'TestManDB', schema 'dbo'.
*/
-- 2. Update:
UPDATE [dbo].[Employee] SET Salary = 900 WHERE EmpCode = 'akashm' -- error
/*
Msg 229, Level 14, State 5, Line 111
The UPDATE permission was denied on the object 'Employee', database 'TestManDB', schema 'dbo'.
*/
-- 3. Delete:
DELETE FROM [dbo].[Employee] WHERE EmpCode = 'akashm' -- error
/*
Msg 229, Level 14, State 5, Line 118
The DELETE permission was denied on the object 'Employee', database 'TestManDB', schema 'dbo'.
*/
REVERT;
GO
As you can see above for ‘userCEO’ account all INSERT/UPDATE/DELETE operations failed on the Employee table, as it only has read/SELECT access.
nbsp;
Usage #2. Now let’s check the ‘userHR’ account which as all permissions on his data:
EXECUTE AS USER = 'userHR';
SELECT * FROM dbo.Employee; -- 3 rows
-- 1. Insert:
INSERT INTO dbo.Employee (EmpCode, EmpName, Salary, MgrCode)
VALUES ('akashm' , 'Akash M' , 550, 'userHR')
SELECT * FROM dbo.Employee; -- 4 rows
-- 2: Update:
UPDATE [dbo].[Employee] SET Salary = 900 WHERE EmpCode = 'akashm'
SELECT * FROM dbo.Employee; -- 4 rows, with Salary = 900
-- 3: Delete:
DELETE FROM [dbo].[Employee] WHERE EmpCode = 'akashm'
SELECT * FROM dbo.Employee; -- 3 rows
-- 4. Update another user's row:
UPDATE [dbo].[Employee] SET Salary = 1000 WHERE EmpCode = 'viveks'
-- (0 row(s) affected)
REVERT;
GO
So, the ‘userHR’ account can modify his records in all 3 INSERT/UPDATE/DELETE operations. But the 4th UPDATE operation fails where he tries to update another user (‘userFin’) record. However this does not displays any error message, but the query output message clearly shows no records were updated.
Usage #3. Execute as our Admin who can insert record for any User:
EXECUTE AS USER = 'userAdmin';
SELECT * FROM dbo.Employee; -- 8 rows
-- 1. Insert row for another user HR:
INSERT INTO dbo.Employee (EmpCode, EmpName, Salary, MgrCode)
VALUES ('akashm' , 'Akash M' , 550, 'userHR')
SELECT * FROM dbo.Employee; -- 9 rows
-- 2. Insert row for another user Fin:
INSERT INTO dbo.Employee (EmpCode, EmpName, Salary, MgrCode)
VALUES ('shantis' , 'Shanti S' , 200, 'userFin')
SELECT * FROM dbo.Employee; -- 10 rows
-- 3. Update other user's rows (HR & Fin):
UPDATE [dbo].[Employee] SET Salary = 900 WHERE EmpCode IN ('akashm', 'shantis')
SELECT * FROM dbo.Employee; -- 10 rows total, last 2 rows with Salary = 900
-- 4. Delete other user's rows (HR & Fin)::
DELETE FROM [dbo].[Employee] WHERE EmpCode IN ('akashm', 'shantis')
SELECT * FROM dbo.Employee; -- 8 rows
REVERT;
GO
And here you can see the ‘userAdmin’ account is able to update all rows belonging to other users as well, as it is configured to behave like that, and this logic is built into the Security function that we build above in Step 3.b, where the Predicate logic looks like this:
-- Predicate logic
WHERE @mgrCode = USER_NAME()
OR USER_NAME() = 'userAdmin';
–> Thus, by using Row Level Security feature in SQL Server 2016 you can build your own customized Security feature for Read & Write operations for Tables by creating Inline Table-Valued Functions with Filter & Block predicates which are linked to the Security Policy for respective tables.
–> Final Cleanup
USE [TestManDB] GO DROP SECURITY POLICY [dbo].[ManagerFilter] GO DROP FUNCTION [dbo].[fn_SecurityFilterPredicateEmployee] GO DROP FUNCTION [dbo].[fn_SecurityBlockPredicateEmployee] GO DROP TABLE [dbo].[Employee] GO
Check the same demo on YouTube:
SQL Server 2016 CTP 3.2 update is here | download now
Microsoft (on 17-Dec-2015) announced the CTP 3.2 update of the recently and initially released Community Technology Preview (CTP) 2.x & 3.0 versions of SQL Server 2016.
[Register and Download the CTP 3.2 Evaluation version (180 days) here]
–> Direct download link (~2.6 GB):
– Download the single ISO: SQLServer2016CTP3.2-x64-ENU.iso
– Or download both EXE & BOX files:
– – Box file SQLServer2016-x64-ENU.box
– – EXE file SQLServer2016-x64-ENU.exe
–> Check version and SQL build:
select @@version
Microsoft SQL Server 2016 (CTP3.2) – 13.0.900.73 (X64) Dec 10 2015 18:49:31 Copyright (c) Microsoft Corporation Enterprise Evaluation Edition (64-bit) on Windows 10 Enterprise 6.3 (Build 10240: )
–> This release has major enhancements on Reporting Services (SSRS):
1. A new Reporting Services web portal is available, with an updated, modern, portal which incorporates KPIs, Mobile Reports and Paginated Reports.
![]()
2. Support for Mobile reports which is based on Datazen technology, optimized for mobile devices and form factors and provide an optimal experience for users accessing BI reports on mobile devices.

3. Design mobile reports using SQL Server Mobile Report Publisher.
![]()
4. For more enhancements check [the SSRS Blog].
–> Few more enhancements in other areas:
1. SQL Server Managed Backup to Microsoft Azure uses the new block blob storage for backup files instead of page blobs. Block blobs have a size limitation of 200GB per blob, whereas page blobs have a size limitation per blob of 1 TB.
2. JSON support now includes the WITHOUT_ARRAY_WRAPPER option, to remove the square brackets that surround the JSON output of the FOR JSON clause by default.
3. With Stretch Database you can specify a predicate to select rows to archive from a table that contains both historical and current data, by using the ALTER TABLE statement.
– You can also unmigrate the data that Stretch Database has migrated to Azure.
– You can now use a federated service account for SQL Server to communicate with the remote Azure SQL Database server when certain conditions are true, by using ALTER DATABASE statement.
4. Analysis Services (SSAS), new functionality for Tabular models at the 1200 compatibility level, including the first wave of JSON scripting in SSMS, DirectQuery, Calculated Tables in SSDT, and other smaller enhancements that add up to a better model design experience.
5. Integration Services (SSIS), enhancements include HDFS-to-HDFS copy support, as well as Hadoop connectivity improvements, including ARVO file format support and Kerberos authentication support.
I’ve covered very few and important points here, you can check all the updates here in [SQL Server blog for CTP 3.2] with details.
For all these new features released in SQL Server 2016, check my blog posts here.
So, download the Preview today and start playing with the new features and plan your DB migration/upgrade.
SQL Server 2016 CTP 3.1 update is here | download now
Microsoft today (01-Dec-2015) announced the CTP 3.1 update of the recently and initially released Community Technology Preview (CTP) 2.x & 3.0 versions of SQL Server 2016.
[Register and Download the CTP 3.1 Evaluation version (180 days) here]
–> Direct download link (~2.58 GB):
– Download the single ISO: SQLServer2016CTP3.0-x64-ENU.iso
– Or download both EXE & BOX files:
– – Box file SQLServer2016-x64-ENU.box
– – EXE file SQLServer2016-x64-ENU.exe
–> Check version and SQL build:
select @@version
Microsoft SQL Server 2016 (CTP3.1) – 13.0.800.111 (X64) Nov 21 2015 16:40:33 Copyright (c) Microsoft Corporation Enterprise Evaluation Edition (64-bit) on Windows 10 Enterprise 6.3 (Build 10240: )
–> Following are enhancements in some areas:
1. New In-Memory OLTP improvements, including Unique indexes, LOB data types, and Indexes with NULLable key columns.
2. The COMPRESS and DECOMPRESS functions convert values into and out of the GZIP algorithm.
3. Programmability improvement for DATEDIFF_BIG and AT TIME ZONE functions.
4. New view sys.time_zone_info added to support date and time interactions.
5. Enhancements to StretchDB, compatible with AlwaysOn and unmigrate the data that Stretch Database has migrated to Azure.
6. Enhancements to SQL Server Analysis Services (SSAS), upgrade your existing Tabular models from 1100/1103 to 1200 compatibility level, Roles support for Tabular 1200 model, and a JSON editor for SSDT.
7. PowerPivot and SSRS/Power View are now available for SharePoint Server 2016 Beta 2.
I’ve covered very few and important points here, you can check all the updates here in [SQL Server blog for CTP 3.1] with details.
For all these new features released in SQL Server 2016, check my blog posts here.
So, download the Preview today and start playing with the new features and plan your DB migration/upgrade.





