THE SQL Server Blog Spot on the Web

Welcome to - The SQL Server blog spot on the web Sign in | |
in Search

Davide Mauri

A place for my thoughts and experiences on SQL Server, Business Intelligence and .NET

  • SQL Nexus 2016 Agenda Online

    It’s here and it’s fantastic:

    Here’s my picks

    • SQL Server Integration Services (SSIS) in SQL Server 2016 – Matt Masson
    • Beautiful Queries – Itzik Ben Gan
    • From SQL to R and beyond - Thomas Huetter
    • Fun with Legal Information in SQL Server: Data Retrieval - Matija Lah
    • Big Data in Production - Brian Vinter
    • Integrate Azure Data Lake Analytics - Oliver Engels
    • DBA Vs. Hacker: Protecting SQL Server - Luan Moreno Maciel
    • Identity Mapping and De-Duplicating - Dejan Sarka
    • SQL Server 2016 and R Engine-powerful duo - Tomaž Kaštrun
    • Dynamic Search Conditions - Erland Sommarskog
    • Normalization Beyond Third Normal Form - Hugo Kornelis
    • Responding to Extended Events in near real-time - Sartori Gianluca

    See you there!

  • SQL Nexus 2016 in Copenhagen

    For 2nd to the 4th of May, in Copenhagen, the SQL Nexus conference will take place and it looks like is going to be one of those events that, if you live in Europe, you really cannot miss.


    Just visit the website to see how awesome is the speaker roster and the, even if the agenda is not yet there, you can already feel that is going to be *really* interesting:

    Now, Beside the following Pre-Conference

    Reference Big Data Lambda Architecture in Azure
    The Lambda Architecture is a new generic, scalable and fault-tolerant data processing architecture, that is becoming more and more popular now that big data and real-time analytics are frequently requested by end users, enabling them to make informed decisions more precisely and quickly. During this full-day workshop we'll see how the Azure Data Platform can perfectly support such an architecture and how to use each technology to build it. From Azure IoT Hub and Azure Stream Analytics to Azure Data Lake and Power BI, we'll build a small Lambda-Architecture solution so that you'll be able to become confident with it and its implementation using Azure technologies.

    that I’ll deliver with my friend Allan Mitchell that I’ve already mentioned before I’m happy to announce that I’ll also have a regular session on Machine Learning, a topic I really love:

    Azure ML: from basic to integration with custom applications
    In this session, Davide will explore Azure ML from the inside out. After a gentle approach on Machine Learning, we’ll see the Microsoft offering in this field and all the feature it offers, creating a simple yet 100% complete Machine Learning solution.
    We’ll start from something simple and then we’ll also move to some more complex topics, such as the integration with R and Python, IPython Notebook until the Web Service publishing and usage, so that we can integrate the created ML solution with batch process or even use it in real time with LOB application.
    All of this sound cool to you, yeah? Well it is, since with ML you can really give that “something more” to your customers or employees that will help you to make the difference. Guaranteed at 98.75%!

    See you there!

  • Using Apache Zeppelin on SQL Server

    At the beginning of February I started an exploratory project to check if Apache Zeppelin could be easily extended in order to interact with SQL Server and SQL Azure. In the last week I’ve been able to have everything up an running. Given that I’ve never used Java, JDBC and Linux since the nineties when I was at university, I’m quite pleased of what I achieved (in just a dozen of hours of no sleep). Here’s Zeppelin running a notebook connected to SQL Azure.


    If you want to test it too, you just have to get it source code from the fork I’ve created here on GitHub, and follow the documentation in order to build it. I’ve just run through the tutorial I’ve put up, and in 15 minutes (max) from when you have logged in in your Ubuntu 15.10 installation, you should be able to have a running instance of Zeppelin with the SQL Server interpreter.

    Here’s the document that describes everything you need to do:

    Now, you may be wondering, why you should be interested in Zeppelin at all? Well, if you’re into Data Science you already know how important is the ability to interactively explore data. And with SQL Server 2016 able to run R code natively, the ability to do some interactive exploratory task is even more important. For yourself and for the business user you will work with. With Zeppelin (just like with Jupyter) creating an interactive query is as simple as that:


    But even if you aren’t into Data Science, Apache Zeppelin is really useful because I really think that the lack of a nice online environment to query SQL Azure is quite annoying. I love SQL Server Management Studio, but sometimes I just need to write a quick-and-dirty query to see if everything in going in the right way or, even better, I’d like to create a (maybe not so) simple dashboard with data stored in SQL Azure or SQL Data Warehouse. And maybe I don’t have my laptop with me, and all I have is a browser.

    Well, Apache Zeppelin is just perfect for all these needs and it is actually much more than that. It’s future looks very promising, so having it also on the Microsoft Data Platform is will make our beloved SQL Server / SQL Azure / SQL Data Warehouse / Azure Data Lake even more enjoyable.

    Right now this version is a sort of on Alpha version and it works only on SQL Server and SQL Azure (I haven’t tested yet on Azure Data Warehouse but should work). It “just works” since, as said at the beginning, this was more and experiment than anything else. Now that I know it is feasible, I’ll rewrite the SQL Server support for Zeppelin (called “interpreter”) from scratch, since for this attempt I’ve started from the postgresql interpreter and as a result the code is not so good (it’s more a patchwork of “let’s try if this works” things)…even if it does the job. So if you download the source and take a look a the code…just keep this in mind, please :-).

    Enjoy it and, as usual, feedbacks are more than welcome. (And help, of course!)


    Support to Azure Data Lake is not yet there. It will come ASAP, but don’t know when yet. :-)

  • Devweek 2016

    I’m really happy to announce that I’ll be back in London, at the DevWeek 2016 Conference, in April. I’ll be talking about

    Though the conference name may imply that it’s dedicated to Developers, in reality there are *a lot* of interesting sessions on Databases, Big Data and, more in general, the Data Management and Data Science area.

    Here’s the Agenda

    I’ll be there along with another well-known name of this blog, Dejan Sarka, just to make sure that the BI/Big Data/Data Science and the likes is well represented among all those developers Smile.

    See you there!

  • (Initial) Conference Plan for 2016

    2016 has not started yet and already looks exciting to me! I already have plans for several conferences and I’d like to share it with you all in case you’re interested in some topics.

    I’ll be presenting at Technical Cloud Day, on January 26th a local Italian event and I’ll be speaking about

    • Azure Machine Learning
    • Azure Stream Analytics

    If you’re interested (and speak Italian) here’s the website:

    I’ll also be present at some international events, like

    SQL Konferenz

    here I’ll delivery my “classic” Agile Data Warehousing workshop, during the Pre-Con days.

    • Why a Data Warehouse?
    • The Agile Approach
    • Modeling the Data Warehouse
      • Kimball, Inmon & Data Vault
      • Dimensional Modeling
      • Dimension, Fact, Measures
      • Star & Snowflake Schema
      • Transactional, Snapshot and Temporal Fact Tables
      • Slowly Changing Dimensions
    • Engineering the Solution
      • Building the Data Warehouse
        • Solution Architecture
        • Naming conventions, mandatory columns and other rules
        • Views and Stored Procedure usage
      • Loading the Data Warehouse
        • ETL Patterns
        • Best Practices
      • Automating Extraction and Loading
        • Making the solution automatable
        • BIML
    • Unit Testing Data
    • The Complete Picture
      • Where Big Data comes into play?
    • After the Data Warehouse
      • Optimized Hardware & Software
    • Conclusion

    You can find more here:

    I’ll also have a regular session dedicated to SSISDB and its internals: SSIS Monitoring Deep Dive. I’ll show what’s inside and how you can use such knowledge to build (and improve) something like my SSIS Dashboard:

    SQL Nexus

    This is a new Nordic Conference where I’ll deliver along with Allan Mitchell where I’ll be presenting a new, super-cool IMHO, workshop. We’ll discuss about the Lambda Architecture, a new generic reference architecture to build Real-Time Analytics solution, and how it can be built using the features that Azure offers. We’ll show how to use Azure Event Hubs, Stream Analytics, Data Lake Power BI and may other cool technologies from Azure.

    You can find more details here:

    Reference Big Data Lambda Architecture in Azure
    The Lambda Architecture is a new generic, scalable and fault-tolerant data processing architecture, that is becoming more and more popular now that big data and real-time analytics are frequently requested by end users, enabling them to make informed decisions more precisely and quickly. During this full-day workshop we'll see how the Azure Data Platform can perfectly support such an architecture and how to use each technology to build it. From Azure IoT Hub and Azure Stream Analytics to Azure Data Lake and Power BI, we'll build a small Lambda-Architecture solution so that you'll be able to become confident with it and its implementation using Azure technologies.

    Well if you’re interested in one or more of these topics, you know where to go now. Bye!

  • Custom Data Provider in Datazen

    Playing with Datazen in the last days, I had to solve a quite interesting problem that took me some time but also allowed me to dig deeper into Datazen architecture in order to find a way to go past its (apparent) limits.

    Here’s the story, as I’m sure will be useful to someone else too.

    One of our current customer has a quite complex Analysis Services dynamic security. Beside applying security on who is accessing the data, they also want to apply security based on how someone access such data. In order to satisfy this requirement a specific extension to Excel (their chosen client) has been developed, and it uses the CustomData() MDX Fuction.

    So, here’s the problem: how can I specify values for CustomData property in the SSAS connection string in DataZen, as there is no such property exposed by default from the native SSAS data provider?

    Luckily DataZen support custom data providers, so it’s quite easy to create a new one that exposes the properties you need:

    I’ve tried to go for the “Overriding built-in data providers” road but I wasn’t able to make it work. I tried to add the “CustomData” property to a file that overrides the default SSAS data provider setting but at the end the “CustomData” property was the only option I was available to see in the overridden native provider. So I created a new SSAS Data Provider and that’s it, everything works perfectly:

                <name>Data Source</name>           
                <name>Initial Catalog</name>

    Be aware that Datazen do *a lot* a caching so you’ll have to stop the Core service BEFORE you edit/create the XML file, otherwise you may find it overwritten with cached data, and also be sure to IISRESET your web server otherwise you can easily get mad trying to understand why what you’ve just done is not showing up in the UI.

    Beside the caching madness, everything works great.

    Hope this helps!

  • Configuring Pass-Through Windows Authentication in Datazen

    I’ve been working with Datazen lately (I’m working with a customer that literally felt in love with it) and one of the last thing we tried as a port of a POC before going into real development, is integration with Windows Authentication.

    It’s really easy to do that, you just follow instructions here (in the section “Authentication Mode”)

    and it just works. As documentation suggest, you just have to specify the domain name and that’s it.

    Of course, after that, you may also want to enable pass-through authentication, so that once a user tries to access a dashboard via HTML interface, Datazen will use the logon credential, without going through and additional logon screen.

    Here things can be tricky if you just follow that documentation here:

    which is correct but only to a certain degree. Everything is correct, it’s only missing to say a *very* important thing that you have to know to make sure that it works as expected: you have to provide ALL FOUR SETTINGS (Server, UserName, Domain, Password) in order to make it work.

    If you forgot to do it during installation, no problem, you can do it later setting the

    • ad_server
    • ad_username
    • ad_domain
    • ad_password

    configuration values as explained here:

    After that, the magic happens, and everything works perfectly


    Of course you have to have configured Kerberos Authentication and Delegation correctly, but that’s another story.

  • SQL Server 2016 CTP 2.3: Management Studio and Data Tools Updates

    After SQL Server 2016 CTP 2.3 has been released, also Management Studio and SQL Server Data Tools has been updated too. Having three different teams working on three different products, means three different places one has to look for to become aware of the updates, so make it easier for everyone who’s asking, here the complete set of link to have a full SQL Server 2016 CTP 2.3 installation (SQL Server Platform + All the Clients):

    SQL Server 2016 CTP 2.3

    SQL Server 2016 Management Studio Preview August 2015 Update

    SQL Server 2016 Data Tools (with support for both Database & Business Intelligence) Preview August 2015 Update


  • SQL Saturday in Italy…English version!

    The 2015 is a special year for Italy, because the country hosts Expo 2015, which is the current Universal Exposition. For this reason, the Italian PASS chapter promotes a special edition of SQL Saturday, a free training event for SQL Server professionals. The SQL Saturday #454 in Turin on October 10, 2015 has the following characteristics:

    • More than 20 sessions, on SQL Server, Business Intelligence and Azure Data Platform.
    • All the sessions will be in English language.
    • The venue is in the center of Turin, close to the train station:
      • You can be at the expo in 40 minute
      • You can travel to Milan in less than 1 hour
    • Turin is usually less expensive than Milan and you might stop for at least one night, dedicating the Sunday after SQL Saturday to visiting the Expo or Milan.

      We want to provide the best experience to the attendees, and we also want to help those of you traveling with family and/or friends that might not interested to technical content. For this reason, we are planning a web page containing information for side and/or alternative activity during the SQL Saturday. You will get more information about that starting in July.

      However, we first need a good estimation of the number of attendees, in order to correctly size the venue and to verify the interest in side activities, so we will module the time to allocate in such a section of the upcoming web site. These operations have to be completed months ahead of the event.

      For this reason, we ask you to fill the survey at, providing us important information about your intention of visiting Expo 2015 and about the number of people who will travel with you.

      If you are a speaker, please submit your sessions, considering that the agenda will prioritize three topics: SQL Server 2016, Power BI, and Azure Data Platform.

      See you in Turin!

    • SQL Konferenz 2015 Slide & Demo

      Last week I spoke at the SQL Konferenz in Darmstad near Frankfurt. The conference was great and I meet a lot of good SQL friends over there. For anyone interested here you can find slide & demos of the session I delivered:

      (Near) Real-Time Data Integration with SQL Server, On-Premises & Cloud

      Schema-Less Table & Dynamic Schema

      You’ll find a link to evaluated the session on SpeakerScore and to download the slides in the last slide of each deck.


    • Iris Multi-Class Classifier with Azure ML

      As many of us I’m passionate about informatics *and* mathematics which, of course, lead me to be passionate about the outcome of their marriage: Databases and Machine Learning.

      Now that Machine Learning is becoming a kind of a “commodity” thanks to AzureML I can finally start to use it in any projects, even the not-so-big-ones.

      AzureML, for those who doesn’t yet know it, is the Machine Learning offer for the cloud by Microsoft. You can freely start to use it just activating your subscription here:

      Once activated you’ll find a lot of ready-to-be-used stuff. From “experiments” (kind of “programs”) and dataset and components and models (algorithms).

      One thing I noticed is missing is the full Iris Dataset, one of the most famous and used dataset to start to learn machine learning. In AzureML you can find a subset of it, usable for binary classification, but the original one is much more interesting since it can be used to do a multiclass classification.

      In order to fill this little gap and to create an easy tutorial to help everyone to start to get confident with AzureML and machine learning in general, I’ve created a 10-Step (well…Italian way of 10 steps Winking smile) tutorial that can be found here: 

      or here

      choose the website you prefer Smile and start to play!

      As usual, comments and feedbacks are more than welcome!

    • SSISDB Monitoring Queries on GitHub

      I’ve moved my SSISDB scripts from Gist to GitHub where I can maintain them more comfortably. So far, I’ve published 6 scripts:

      • ssis-execution-status: Latest executed packages
      • ssis-execution-breakdown: Execution breakdown for a specific execution
      • ssis-execution-dataflow-info: Data Flow information for a specific execution
      • ssis-execution-log: Information/Warning/Error messages found in the log for a specific execution
      • ssis-execution-lookup-cache-usage: Lookup usage for a specific package/execution
      • ssis-execution-package-history: Execution historical data

      I used them almost every day when I need to have a quick glance to what’s going on on Integration Services and when I need to do some deep analysis of errors and problems.

      You can find them here:

      If you’re also wondering what happened to the SSIS Dashboard project

      …don’t fear, it’s not dead. I’m still working on it, but since I’m working on it only in my free time, updates are taking much more time than expected.


      Funny enough, Andy Leonard published a script to analyze lookups just couple of hours before me. You may also want to take a look at his post:

    • SQL Konferenz 2015

      On the first days of February I’ll be speaking at the German SQL Konferenz 2015 in Darmstad (Frankfurt) with a lot of other friends:

      I’ll be talking about two topics that my developer side love at most : Service Broker and “Dynamic Schema”:

      Schema-less table & Dynamic Schema
      How to manage a system in which the schema of data cannot be defined "a priori"? How to quickly search for entities whose data is on multiple lines? In this session we are going to address all these issues, historically among the most complex for those who find themselves having to manage yet very common and very delicate with regard to performance. From EAV to Sparse Columns, we'll see all the possible techniques to do it in the best way possible, from a usability, performance and maintenance points of view.

      Real Time Data Integration (in the Cloud or not)
      Service Broker and Integration Services can work so well together that they allow the creation of high-performance Real Time Data Integration solution with just a few days of work. No matter if you're on premise or on Azure, a real-time integration will open up new opportunities to deliver data and information faster and more efficiently, empowering the end user with all they need to do a great job. Let's say that your ERP software is on premise and you need to create a real-time dashboard in the Cloud...or that you have to integrate with your cloud-based sales force management solution. Do you really think that a batch update every 15 minutes can be solution, while for the same price you can have something done in real-time? In this session we'll see how to build such solution (that allowed one of our customer to completely replace TIBCO), from start to end.

      See you there!

    • Expired Account Password on a Azure VM

      Today I faced a really nasty problem. I’m really getting in love with Azure and especially with SQL Server hosted in Azure VM. It opens up a huge amount of opportunities, for small, medium and big companies, since they can have everything they ask for but without the burden of having to maintain a server factory.

      That’s very cool, but the inability to physically log into server can give you some headaches if RDP doesn’t work as expected. For example when you’re not in a domain and your password expires. It seems that no-one in Microsoft cared to fix the problem, since is still there even if people reported it back in 2013

      Today I had exactly the same problem. At some point the RDP client started to return me the error

      “The Local Security Authority Cannot be Contacted”

      After having spent some time trying to find out what could be the cause of the error (even following some wrong roads, given the fact that the error is just too generic), I thought that could be due to the fact that the password was expired. And that was exactly the problem. This post (even older than 2013, so the problem is even older….) confirmed me that my idea could be correct.

      Unfortunately the aforementioned posts states the problem, but doesn’t really describe how to solve it in my specific case. The main problem is that if the server requires the Network Level Authentication, the RDP client won’t show you the “Password Expired” screen, so you won’t be able to change the password. This means that you cannot access your VM anymore, which is not fair. By default NLA is enabled on Windows Server 2012 R2 and since I couldn’t log in, I couldn’t even disable it, so I was stuck with my problem.

      Anyway, at least now I know where to look for. Still, I had to solve another problem: how do I change a password for an Azure VM to which I cannot connect using RDP? Luckily it seems that there are a lot of people that forgot their passwords, and so they need to reset it, so the problem is well known. Here there are two post that explain how to do it using PowerShell and the related Azure PowerShell Module.

      The PowerShell script works if and only if the VM Agent is installed. Luckily this is the default option when you provision a new Azure VM, so you haven’t anything special do to in order to have it installed.

      Well, now you know it, keep it in mind in case you find yourself in the same situation.

    • Using NLog With BIDS Helper to add logging to BIML Script executions

      When using BIML within BIDS Helper, if your BIML Script files get complex it may be quite hard to debug BIML Script Execution in order to understand what’s going on behind the scenes.

      On Windows Server 2008 it was possible to use the System.Diagnostic.Debug.WriteLine and DebugViewer from SysInternal to do the trick but it seems that this approach doesn’t work anymore on Windows Server 2012. Or, at least, I wasn’t able to make it work. Anyway, in addition to that, I was also trying to have everything logged to a file so one doesn’t have to use and configure DebugViewer to do its job. DebugViewer is great tool, but it’s not really suitable for junior developers.

      So I tried to use the fantastic NLog framework in order to create a “standard” way of logging BIML. First of all download it (just get the standard version, no need to grab the “Extended” one) and unpack into a folder named “NLog-3.0” where you prefer.

      Now in your SSIS Solution create a BIML file named “BimlLogger.biml” and copy and paste the following code:

      <#@ template language="C#" #>
      <#@ assembly name="C:\Work\Lab\BIML-Debug\NLog\NLog-3.0\net40\NLog.dll" #>
      <#@ import namespace="System.Diagnostics" #>
      <#@ import namespace="NLog" #>
      <#@ import namespace="NLog.Config" #>
      <#@ import namespace="NLog.Targets" #>

          Logger logger = LogManager.GetLogger("BIML");

          LoggingConfiguration config = new LoggingConfiguration();

          FileTarget fileTarget = new FileTarget();
          config.AddTarget("file", fileTarget);

          fileTarget.FileName = @"${nlogdir}\..\..\biml.log";
          fileTarget.Layout = "${longdate}|${level:uppercase=true}|${message}";
          fileTarget.DeleteOldFileOnStartup = true;

          LoggingRule loggingRule = new LoggingRule("*", LogLevel.Trace, fileTarget);

          LogManager.Configuration = config;   

      Change the second line (the “assembly name” line) in order to reflect the path where you unpacked NLog and then you can start to log anything you think it can help you just referencing this file from any other BIML files and then using the “logger” object to write to the log file. Here’s an example of a BIML script file that creates a test package.

      <#@ template language="C#" #>
      <#@ include file="BimlLogger.biml" #>

          logger.Info("Generating Package...");

      <Biml xmlns="">
          <Package Name="Test" ConstraintMode="Linear" ProtectionLevel="EncryptSensitiveWithUserKey" />


      The log file will be created in the “NLog-3.0” folder you created before. Of course you can change this and many other option, since NLog is really flexible and powerful. Documentation and tutorial are here:

      2014-12-13 Update

      In order to have the trick working, you have to be sure that the NLog assembly is *not* blocked…which is something will happen automatically if you download the zip from internet. In order to unblock the assembly you have to right-click on it and then select “Unblock”:


    This Blog


    Privacy Statement