T-SQL Advice For Young, Old, and even Eccentric
Be mindful of advice. Give an ear to those offering it. Just be mindful, there is no need to accept the advice, but it is wise to at least...
2022-04-22 (first published: 2022-04-12)
830 reads
Be mindful of advice. Give an ear to those offering it. Just be mindful, there is no need to accept the advice, but it is wise to at least...
2022-04-22 (first published: 2022-04-12)
830 reads
Checkpoints are essential in SQL Server to help with the durability and reliability of data persisted in the database. When done right, you barely even notice them and performance...
2022-02-02 (first published: 2022-01-14)
486 reads
Bulk insert can be an extremely helpful tool to help ingest data into SQL Server efficiently. Sometimes, it is necessary to capture metrics in regards to the bulk insert...
2022-01-24 (first published: 2022-01-07)
729 reads
Every Database has a DBO or database owner set. Sometimes the owner is invalid, while most of the time the DBO is perfectly normal. It is easy to ignore...
2022-01-17 (first published: 2022-01-05)
652 reads
Having a Database Owner is not something that most people think about until something breaks. Usually, people will just kind of ignore it because it is just so innocuous...
2022-01-14 (first published: 2021-12-31)
335 reads
Stability and reporting go hand in hand. You cannot truly have stability without reporting. Take the time to share the stability successes with the business. Let them revel in...
2022-01-10 (first published: 2021-12-27)
328 reads
No matter how you name it, "hairball", "spaghetti code", "tech debt" or "DIY code", the result is the same - you are dealing with legacy code that nobody wants...
2022-01-05 (first published: 2021-12-25)
353 reads
This is a very simple introduction into the creation of an Extended Event session using a template for Azure SQL DB. I demonstrate the use of the GUI to...
2022-01-02
42 reads
Source control is quintessential to a productive development environment. A well maintained and organized source control system is akin to having known-good database backups. Having the right tools to...
2022-01-02
41 reads
Excessive memory grants are extremely problematic in SQL Server. These excessive grants do not just happen out of the blue. Memory grants are directly linked to the queries.
The post...
2022-01-01
89 reads
By davebem
I was the principal author of this SIOS whitepaper, which describes how to build...
By Brian Kelley
I am able to head back to Seattle for the PASS Summit this year....
By Brian Kelley
I still have a tendency to talk about all the cons of a proposed...
Comments posted to this topic are about the item The Cloud Security Problem
Comments posted to this topic are about the item Virtualizing AWS data by using...
Comments posted to this topic are about the item Timescale Brings PostgreSQL into the...
I have this data in a SQL Server 2022 table:
player yearid team HR Alex Rodriguez 2012 NYY 18 Alex Rodriguez 2013 NYY 7 Alex Rodriguez 2014 NYY NULL Alex Rodriguez 2015 NYY 12 Alex Rodriguez 2016 NYY 9If I run this code, what are the results returned in the hrgrowth column?
SELECT player , yearid , hr , hr - LAG (hr, 1, 0) IGNORE NULLS OVER (ORDER BY yearid) AS hrgrowth FROM dbo.playerstats;See possible answers