SQL Server

  • Loan Amortisation in SQL Server (PMT, FV, IPMT, PPMT)

    Whilst designing a data warehouse for a banking client recently, I needed to calculate projected future loan payments (including breaking this down by interest and capital payments) for every customer throughout the life of the loan. In Excel this is a pretty simple job, as Microsoft helpfully provide a number of functions to do just that (namely PMT, FV, IPMT and PPMT). In SQL Server however we do not have the luxury of having ready made…

    » Read more
  • SQL Bits 6 – Registration Open

    For anyone interested in SQL Server, the unmissable SQL Bits conference is returning for round six. “SQL Bits – The 6th Sets” is being held in central London for the first time, and unlike previous conferences it will be for one day only on Friday 16th April 2010. It’s being held as part of the SQL Server 2008 R2 release, also happening that week in London. Registration is now open, you can find out more at the SQL Bits…

    » Read more
  • Data Warehouse Presentation

    Purple Frog is presenting a session on data warehouse design concepts at the South Wales SQL Server User Group on Thursday 25th February 2010. If you’re in the area and want to come along you can register for free here. Eversheds are hosting the event in their Cardiff office. Adam Morton will be demonstrating an ETL control framework in SSIS, and Alex Whittles will be discussing the concepts of data warehousing and the fundamental…

    » Read more
  • Dynamic MDX in Reporting Services

    After a couple of days off work last week with SQL Bits III and SQL 2008 Unleashed, it’s back to the grindstone this week; however before I get onto the serious stuff I’d like to say thank you to the organisers of both events. Watching you on stage headbanging to Rockstar – legendary! (You can see for yourself here and here…). Anyway, back to MDX… This post explains how you can build a dynamic MDX query in Reportins…

    » Read more
  • SQLBits III and more…

    Next week we’re lucky enough to have a double-whammy of SQL events in the UK, has Christmas come early?… On Wednesday 10th September, Microsoft are running a live Technet event, SQL Server 2008 Unleashed, at their Reading campus. It looks like it should be a day well spent, with Prem Mehra delivering a keynote speech on large scale SQL Server systems, and other sessions including data warehouse improvements, upgrade paths, and a…

    » Read more
  • Use Stored Procedure Output Parameters in SSRS

    It’s commonly known that there are a few frustrations when using stored procedures as the source for SSRS 2005 datasets, the inability to cope with temporary tables is always a key one, another is not being able to get at output parameters or return values. This post explains the easiest way to get at the output parameters and return value. Lets assume you are using the following stored proc: IF OBJECT_ID('myProc') IS NOT NULL DROP…

    » Read more
  • SSRS Report Performance monitoring

    Today’s Frog-Blog top-tips are quite simple ones, but ones that I always find very useful. SSRS Report Performance monitoring. Once you start to build up a few Reporting Services reports, you need to find out how they’re performing, whether any particular reports are causing the server problems and even which users are running which reports. The following set of queries should point you in the right direction. They should all be run…

    » Read more
  • Semi Additive Measures using SQL Server Standard

    One of the most frustrating limitations of SQL Server 2005 Standard edition is that it doesn’t support semi additive measures in SSAS Analysis Services cubes. This post explains a work around that provides similar functionality without having to shell out for the Enterprise Edition. What Are Semi Additive Measures? Semi Additive measures are values that you can summarise across any related dimension except time. For example, Sales and…

    » Read more
  • Extract Datasource and Query from Excel Pivot

    Have you ever tried to reverse engineer an Excel pivot table? It’s not as easy as you would think! Whether you just want to find out the datasource details, or identify the query that was used, there is just no simple way of getting Excel to tell you. The macro below will loop through every sheet in a workbook, and will document the datasources, SQL or MDX queries as well as the page, row, column and data fields. To use it, add it into…

    » Read more
  • Report Parameter Selection Memory

    This post explains a method of enhancing Reporting Services reports to make them more user friendly. I have been quizzed many times by end users who want reports to remember the parameter selections so that next time they run the report they haven’t got to re-select the same parameters. This is especially useful if there are a lot of long parameter lists, and each user tends to run the same selection frequently. This process is made…

    » Read more