I was writing some dynamic SQL that generates some SQL statements to load my facts and dimensions into a data warehouse. Some of those SQL statements can become very long, for example if a dimension has a lot of columns. When debugging, I noticed a couple of statements failing with various errors. Turns out, they […]
Tag: tsql
The GREATEST new T-SQL Function
If the title isn’t obvious enough, this blog post is about the new function GREATEST, and it’s sibling LEAST. But wait, how come there’s a new T-SQL function? There isn’t a new release of SQL Server! That’s right, those two new functions are released in Azure SQL DB, Azure SQL Managed Instance and Azure Synapse […]
#TSQL2sday 136 – Your Favorite Data Type
It’s T-SQL Tuesday time again, and this month’s honor to host the blog party goes to Brent Ozar. The topic is data types: Mad about money? Feverish about float? Tell us what you use your favorite data type for, and what people need to know before they get started using it. Data types have so many interesting […]
Nesting Aggregates with Window Functions
Recenty I was writing an article for MSSQLTips where I had to create a treemap (it will be published soon). As sample data, I used the different folders containing the drafts for all the tips I ever wrote. As measures, I have the number of kilobytes and the number of items per folder. An example: […]