Converting Rows to Columns (PIVOT) and Columns to Rows (UNPIVOT) in SQL Server
Learn how to convert row values into column values (PIVOT) and column values into row values (UNPIVOT) in SQL Server.
Learn how to convert row values into column values (PIVOT) and column values into row values (UNPIVOT) in SQL Server.
Redgate is researching how people deploy their database changes. This is a very quick survey, and there's an opportunity to sign up for a research call in exchange for a $50 Amazon voucher.
This article shows how you can use SQL Server spatial methods, mathematical rules and oscillating patterns to benchmark CPU, IO and Hekaton performance.
The debate over how to change code or solve a problem can create arguments that last for years. Steve Jones notes the idea of limiting debates to five minutes is interesting.
CSS Engineers at Microsoft are reporting more space issues with database systems. Steve Jones has a few comments.
WMI (Windows Management Instrumentation) is the basic way of querying and changing basic information about any windows server, including SQL Server or Exchange Server. It provides a logical structure and representation of systems and services that are hosted on the server and is essential for anyone who is keen to automate routine monitoring and administration work via PowerShell, especially where many servers are involved in the task.
Why do stored procedures help with security? In this piece, MVP Brian Kelley explains why SQL Injection and information gathering are hampered with stored procedures.
Tim Hidalgo goes through some practical demos to show you how you can automatically keep your testing environments up to date, and ship more robust databases.
Reporting Services provides a robust reporting platform that rivals many other products. New author Adam Aspin stars a series on how you can dress up your reports and maintain good development practices.
By ReviewMyDB
Index maintenance has always meant nightly jobs and a window you have to defend....
I’m sure you’ve all heard the tale of Goldilocks and the Three Bears, but...
By Steve Jones
One of the things I’ve been requesting for a number of years is cost...
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