Cumulative sum of previous rows
I had an update statement that took 3 minutes to run after this code change it took 6 seconds.
2015-03-27 (first published: 2014-05-08)
34,702 reads
I had an update statement that took 3 minutes to run after this code change it took 6 seconds.
2015-03-27 (first published: 2014-05-08)
34,702 reads
2015-02-17
1,955 reads
2015-01-26
12,063 reads
When facing a problem you aren't sure you can solve, keep working on it and believe in yourself.
2014-07-08
238 reads
I inherited a database that was getting large and not performing well. After adding primary keys life got better.
2014-06-30
14,741 reads
2014-06-17
227 reads
When we focus on negative things we get more negative. Be thankful for something positive.
2014-06-10
175 reads
Some people set their default database to the database they use most often. This can cause issues when a restore fails.
2013-11-14
7,511 reads
2012-12-19
2,246 reads
Ben Kubicek wrote a recursive function that solves simple math expressions in a select statement. Read about this creative use of T-SQL.
2011-11-21
5,929 reads
By Arun Sirpal
Every DBA has a box like this. Sitting untouched for months. Nobody’s proud of...
By Steve Jones
I type fairly well. Well, I type fast, but I do wear out a...
By way of background, a while back I did video called “My New Favourite...
Comments posted to this topic are about the item SQL Art, Part 4: Happy...
Comments posted to this topic are about the item How We Handled a Vendor...
Comments posted to this topic are about the item Cognitive Coverage
I have this data in the dbo.Commission table in a SQL Server 2022 database.
salesperson commission Brian 12 Brian 16 Andy 7 Andy 14 Andy 21 Steve 20 Steve NULLAll the data is a varchar, and I decide to run this query to get the totals for each salesperson.
SELECT SalesPerson
, AVG(TRY_PARSE(Commission AS int)) AS TotalCommission
FROM commission
GROUP BY SalesPerson
GO
What average commission is calculated for Steve? See possible answers