Hopefully MS will implement Standard SQL's LAG/LEAD/FIRST_VALUE/LAST_VALUE including the option in a future release. Then it's a simple "LAG(col1 IGNORE NULLS) OVER (ORDER BY id)"
T-SQL Challenge - CombinationsCommented on: 7 years ago
(January 28, 2008)
I like that puzzle, you just have to know how recursive queries work :-)
WITH cte (vid, amt)
SELECT vid, amt
SELECT v.vid, cte.amt + v.amt
FROM vouchers AS v...
Mode PuzzleCommented on: 7 years ago
(October 4, 2007)
Nested aggregates, before SS2005 this was quite awfull, but now there's WITH or (my favourite) OLAP functions: Easy to write and easy to extend
Digital Magazine Archives
Browse back issues of SQL Server Pro, from January 2007 through the last issue published in April 2014. Find the back issues here.
My initial goal in writing this series of posts was to outline some of the concerns surrounding Availability Groups (AGs) and SQL Server Agent Jobs – and call out how there is virtually no guidance from Microsoft on this front and then detail some of the pitfalls and options available for tackling this problem domain. I initially expected this series of posts to have between 25 and 30 posts – according to some of the early outlines I created ‘way back when’....More
Throughout this series of posts I’ve taken a somewhat pessimistic view of how SQL Server Agent jobs are managed within most organizations – meaning that most of the code and examples I’ve provided up until this point were based on assumptions about how CHANGE to jobs is managed. That pessimism, to date, has come in two forms:...More
In this series of posts I’ve called out some of the concerns related to SQL Server AlwaysOn Availability Groups and their interaction with SQL Server Agent jobs – both in the form of Batch Jobs (see post #3) and backups....More