Quiz: TSQL Enhancements in SQL Server 2014 and 2016

Quiz: TSQL Enhancements in 2014 and 2016 🎉

  • CREATE OR ALTER PROCEDURE Warehouse.StockItemsByColor
    @ColorName NVARCHAR(20)
    AS
    SELECT
    si.StockItemName
    FROM Warehouse.StockItems AS si
    JOIN Warehouse.Colors AS c on si.ColorID=c.ColorID
    WHERE c.ColorName = @ColorName;
    GO
  • DROP PROCEDURE IF EXISTS Warehouse.StockItemsByColor, Warehouse.StockItemsBySize;
    GO
  • SELECT
    SYSDATETIMEOFFSET() AS instance_time,
    SYSDATETIMEOFFSET() AT TIME ZONE 'UTC' AS utc_time;
    GO
  • CREATE TABLE dbo.indexes_inline (
    i int identity not null,
    j nvarchar(10),
    k bigint,
    l int,
    index nc_j_k (j, k)
    );
    GO
  • SELECT *
    FROM string_split('split,this,string',',');
    GO
  • TRUNCATE TABLE Purchasing.SupplierTransactions WITH (PARTITIONS (1, 5));
    GO

Grab the code to play around with the samples

The code samples shown on the questions are right here.

References and further reading