Toronto, Ontario, Canada

Eastern Time Zone

info@maximconsulting.ca

Articles

  • The importance of data type for averaging

    Here is a small cautionary tale for those, who use Average function in SQL Server. The data type of the aggregated data element greatly influences the result of AVG aggregate function.With source data set defined as INT, the result of the straight…

    Know More

  • Database recovery procedure for corrupted databases

    Follow the following procedure to recover corrupter SQL Server database. It is assumed that database is in full recovery mode, full database backup is available and transaction log backups was taken sometime before the failure.If database has been corr…

    Know More

  • Quick and simple aggregation of Hierarchical Data in SQL Server

    Sometimes data containing hierarchies have to be aggregated and total calculated on different levels. The following script will help archive fast calculation of totals on each level of hierarchy.INPUT DATA STRUCTURE AND VALUES0100***Level 1*****$210110…

    Know More

  • Statistical function in T-SQL

    In my current project I need to calculate mean, mode, median and percentiles (95th percentile, 99th percentile) of a given data set.In this article I’ve put together a summary of what I’ve discovered during my research.The following code snippets …

    Know More

  • Script to de-normalize Parent – Child Hierarchy

    Parent Child data hierarchies are great for storing hierarchical data, however it becomes a major pain when you need to convert hierarchy structure into a flat view (e.g. to be used in reporting or SSAS cubes). While SSAS provide a build…

    Know More