SQL SERVER – Introduction to FIRST _VALUE and LAST_VALUE – Analytic Functions Introduced in SQL Server 2012

SQL Server 2012 introduces new analytical functions FIRST_VALUE() and LAST_VALUE(). This function returns first and last value from the list. It will be very difficult to explain this in words so I’d like to attempt to explain its function through a brief example. Instead of creating a new table, I…
Read More

SQL SERVER 2012 Functions – 14 New Functions – A Quick Guide

Last two weeks I wrote various blog posts on new functions introduced in SQL Server 2012. So many comments and request I have received from various readers that they would like to see everything together. I have put up a quick guide here where I am writing all the 14 new SQL Server 2012 Functions linking them to my blog post as well Book On-Line for a quick reference.

Read More

SQL SERVER – Denali – Date and Time Functions – EOMONTH() – A Quick Introduction

In SQL Server Denali, seven new datetime functions have been introduced, namely, DATEFROMPARTS (year, month, day) DATETIME2FROMPARTS (year, month, day, hour, minute, seconds, fractions, precision) DATETIMEFROMPARTS (year, month, day, hour, minute, seconds, milliseconds) DATETIMEOFFSETFROMPARTS (year, month, day, hour, minute, seconds, fractions, hour_offset, minute_offset, precision) SMALLDATETIMEFROMPARTS (year, month, day, hour, minute)…
Read More

SQL SERVER 2012 – DateTime Functions – DATEFROMPARTS() – DATETIMEFROMPARTS() – DATETIME2FROMPARTS()

In SQL Server 2012, there are seven new datetime functions being introduced, namely:

DATEFROMPARTS ( year, month, day)
DATETIME2FROMPARTS ( year, month, day, hour, minute, seconds, fractions, precision )
DATETIMEFROMPARTS ( year, month, day, hour, minute, seconds, milliseconds )
DATETIMEOFFSETFROMPARTS ( year, month, day, hour, minute, seconds, fractions, hour_offset, minute_offset, precision )
SMALLDATETIMEFROMPARTS ( year, month, day, hour, minute )
TIMEFROMPARTS ( hour, minute, seconds, fractions, precision )
EOMONTH ()

Read More