Business Intelligence & Data Warehousing

Queries you can use tomorrow.

Practical blogs about SQL Server, data warehousing, Power BI and reporting. With the code.

SELECT*FROMsqlblog.blogsORDER BYdateDESC;

  • 134blogs
  • 1,673,558reads
  • 72comments
  • 2008first blog
  1. Microsoft MDS end of life: your options before 2028

    Microsoft removed Master Data Services from SQL Server 2025, and SQL Server 2022 mainstream support ends on 11 January 2028. What that means for your MDS models, and how the alternatives compare.

    SQL Server, Data Warehousing1 Nov 2026 · new
    new
  2. Service areas per branch on the postcode map: who serves which postcode?

    A table with postcode ranges per branch, on a map of all 4,071 postcode areas. With the T-SQL that finds gaps, overlaps and areas assigned to the wrong branch.

    HTML Reporting, SQL Server28 Oct 2026 · new
    new
  3. How the Netherlands was built: 9.3 million addresses by year of construction on a map

    A moving map of the Netherlands, decade by decade, from the year of construction of 9.3 million addresses. With the T-SQL behind it, so you can run it yourself.

    HTML Reporting28 Oct 2026 · new
    new
  4. Faster AS400 loads into SQL Server: one column per row

    How we cut the fetch of 361,899 IBM i rows from 487 seconds to 57 to 95 seconds by packing 76 columns into one string, and how we kept it safe.

    SQL Server, Data Warehousing28 Oct 2026 · new
    new
  5. When a PBIX won't upload to Report Server: a PBIR round-trip gone wrong

    I lost an afternoon to this one, so here it is in case it saves someone else the same trip. The setup is an on-prem Power BI Report Server, fully patched, running the May 2026 release ( ...

    SQL Server16 Jun 2026 · 1.1k reads
    1.1k
  6. Quickly Reorder MDS Attributes Using SQL Updates

    If you've ever used Microsoft Master Data Services (MDS), you've probably noticed one of its more annoying limitations: there’s no drag-and-drop interface to reorder attributes within an entity . ...

    SQL Server25 Jun 2025 · 1.9k reads
    1.9k
  7. Keeping Your SQL Server Statistics Fresh: A Guide to Optimal Database Performance

    If you've ever wondered why your perfectly tuned SQL query suddenly starts crawling at a snail's pace, the culprit might be stale statistics. In SQL Server, statistics are like the GPS system for ...

    SQL Server6 Jun 2025 · 3.5k reads
    3.5k
  8. Build your own brain with MyGPT: metadata, logic and answers at your fingertips

    We all know it: you have built up years of knowledge about your data warehouse, the logic of procedures, the structure of your reports and the how and why of all kinds of column names. But it is either ...

    SQL Server5 Jun 2025 · 1.9k reads
    1.9k
  9. AI as your SQL sidekick: how ChatGPT and Claude make your code faster and better

    Anyone who writes SQL regularly knows there are three kinds of queries: The quick one-line selects, The 'just tinker a bit' report queries, And the real brain teasers with 8 joins, subselects and ...

    SQL Server5 Jun 2025 · 1.8k reads
    1.8k
  10. Using Claude to write SQL queries: blessing or trap?

    In recent years, Large Language Models (LLMs) such as GPT from OpenAI and Claude from Anthropic have become better and better at understanding and generating code. Where you used to sit puzzling ...

    SQL Server5 Jun 2025 · 1.8k reads
    1.8k
  11. How to Truncate All Tables in a Database While Preserving Foreign Keys: A Complete Script

    When testing a data warehouse , a common challenge is managing large datasets effectively. Often, you need to reset tables to a clean state, ensuring consistent testing environments. The most ...

    SQL Server, Data Warehousing27 Jan 2025 · 6.3k reads
    6.3k
  12. Introducing the RANK Window Function in DAX: An Overview and Example

    Introducing the RANK Window Function in DAX: An Overview and Example Data Analysis Expressions (DAX) is a collection of functions, operators, and constants used in Microsoft's Power BI, Analysis ...

    Power BI20 Jun 2023 · 4.8k reads
    4.8k
  13. Understanding Lakehouse, Warehouse, and Datamart: The Differences Between the Three Fabric Objects

    In the world of data management, there are several data storage and processing models that organizations use to handle their ever-growing data needs. Three of these models, which have risen to ...

    Data Warehousing13 Jun 2023 · 3.7k reads
    3.7k
  14. Unveiling the Power of the New Card Visual in Power BI: Zebra BI Cards 1.6

    In the world of data visualization and business intelligence, Microsoft Power BI continues to evolve and introduce powerful new features that enhance data reporting and analysis. One of the standout ...

    Power BI13 Jun 2023 · 3.9k reads
    3.9k
  15. The Correspondence Between Excel Formulas and DAX Formulas: Why Financial Analysts Should Learn DAX

    Excel, a widely used tool in the world of finance, has been the go-to platform for data analysis for decades. The formula-based structure of Excel allows analysts to manipulate, aggregate, and ...

    Data Warehousing, Power BI12 Jun 2023 · 4.4k reads
    4.4k
  16. Advanced T-SQL Window Functions: A Comprehensive Guide with Examples

    Title: Advanced T-SQL Window Functions: A Comprehensive Guide with Examples Introduction Transact-SQL (T-SQL), Microsoft's proprietary extension of the SQL language, provides a rich set of tools for ...

    SQL Server12 Jun 2023 · 3.8k reads
    3.8k
  17. Top 5 Ways to Optimize Your SQL Server CPU Usage

    Introduction SQL Server is a powerful relational database management system developed by Microsoft. It is widely used in various industries for data storage, processing, and retrieval. However, like ...

    SQL Server12 Jun 2023 · 5.2k reads
    5.2k
  18. Get the Most out of Customer Data with a Postcode Table: Your Guide to Successful Data Analysis

    A postcode table is basically a database of all postcodes in a certain country, in this case the Netherlands. It holds not only the postcodes themselves, but often also other useful data such as ...

    SQL Server12 Jun 2023 · 2.7k reads
    2.7k
  19. SQL Server Disk Performance Metrics: An In-depth Guide

    Understanding your SQL Server's disk performance metrics is crucial for maintaining an efficient, high-performing database. These metrics provide insights into how well your storage system is ...

    SQL Server12 Jun 2023 · 5.2k reads
    5.2k
  20. 10 Common Mistakes in SQL Server Performance Optimization and How to Avoid Them

    Sure, here is a draft for the blog post: Microsoft SQL Server is a powerful, robust and feature-rich relational database management system (RDBMS). Despite its capabilities, improper usage or ...

    SQL Server12 Jun 2023 · 4.1k reads
    4.1k
  21. Unleashing the Power of Data: How Industry Leaders Implement Microsoft Power BI

    Introduction Microsoft Power BI is a suite of business analytics tools that enables organizations to analyze data and share insights. Through its comprehensive dashboards, interactive reports, and ...

    SQL Server12 Jun 2023 · 2.7k reads
    2.7k
  22. From Excel to Power BI: Transitioning to Advanced Analytics

    Over the past few decades, Excel has firmly established itself as a cornerstone of data management, manipulation, and visualization. However, in the evolving world of data analytics, tools like ...

    SQL Server12 Jun 2023 · 2.8k reads
    2.8k
  23. Making Sense of Time: An Introduction to SQL Server's DateTime Functions

    When it comes to managing and manipulating data, there's no doubt that SQL Server is one of the most popular choices. One of the reasons for its popularity is the rich set of functions it provides ...

    SQL Server12 Jun 2023 · 3k reads
    3k
  24. Postcode Tables in Databases and Power BI: Linking Geographic Information to Business Performance

    In data analysis and business intelligence it is essential to understand not only numbers and statistics, but also the geographic context of that data. This is where the ...

    SQL Server5 Jun 2023 · 1.9k reads
    1.9k
  25. Making active bold buttons in Power BI

    When you work with buttons in Power BI, for example to work with bookmarks, it is useful to see which "view" is active in your report. It is a bit like the idea of web ...

    SQL Server8 Apr 2022 · 13.1k reads
    13.1k
(25 rows affected)sqlblog.nl