Tags » T-SQL

Windowing without a partition by or an order by

If you’ve never worked with windowing functions they look something like this:

SELECT name, max(create_date) OVER 
		-- No this isn't meant to make sense
		(PARTITION BY lower(left(name,1)) ORDER BY owner_sid)
FROM sys.databases; 312 more words
SQLServerPedia Syndication

Raw SQL and SqlAzureExecutionStrategy

If you are using Entity Framework to run raw SQL queries directly against the database and are using SqlAzureExecutionStrategy for retrying SQL Azure transient failures, you might be getting “The SqlParameter is already contained by another SqlParameterCollection” exceptions. 43 more words


Use below script to have dynamic Insert into statments.

Typically may be used to replicate data from one database to another


125 more words

Dynamic Data Masking

As part of my prep for exam 70-761 (Querying Data with Transact-SQL) I’m writing about a few of the new features available in SQL Server 2016 that weren’t included in the 70-461 exam I took a few years ago based on SQL Server 2012. 2,072 more words

Exam Preparation

Paging in T-SQL

As part of my prep for the 70-461 exam I learnt how to use the new paging functionality that was made available in SQL Server 2012.  329 more words


Numeric Padding in T-SQL

I was recently trying to find a way to pad a number in
T-SQL and decided to share what I found. Let us say I wanted to pad… 31 more words


Get the join cheat sheet!

Download and print this nifty little PDF with all of the INNER, LEFT, RIGHT, FULL and CROSS JOINs visualized! It’ll look great on your office wall or cubicle. 68 more words