Take maximum advantage of Grouping Sets, Roll-up, Cube and Pivoting

This article explains, with detailed examples, how to use PIVOTING to take maximum advantage of queries making use of GROUPING SETS. Besides, ROLLUP and CUBE operators will be analysed as well. We'll see throughout the article that it's very easy to get simple, practical and powerful queries by integrating all of them in the same query.

I think that master these operators contributes to make cleaner code and save a lot of time when developing. Thus, I hope this article will be useful to both improve your knowledge and develop faster cool queries for your reports, forms or views.

[More]

Azure Files Storage Services

In this post, I will be exploring the Azure Files Storage Services to manage files by using the SMB (Server Message Block) protocol. The most relevant part of the use of this service is that you can attach it to a virtual disk on your Windows machine to deal with files as it were an external disk.

[More]

Azure BLOB Storage Services

This post is a quick guide to start dealing with Azure BLOB Storage Services. I will create a simple .Net Console Application to upload and download a simple file within BLOB Storage Services. Before going ahead, I highly recommend take a look to How to create an Azure Storage Account. It is not complex but mandatory before interacting with BLOB Storage Services.

[More]

Rewriting URLs to redirect HTTP requests

This post is a quick guide to start dealing with Azure BLOB Storage Services. I will create a simple .Net Console Application to upload and download a simple file within BLOB Storage Services. Before going ahead, I highly recommend take a look to How to create an Azure Storage Account. It is not complex but mandatory before interacting with BLOB Storage Services.

[More]

Row Level Security in SQL Server

Row-Level Security let us control access to data at row level for any SQL Server table based on users, roles, membership or working context. It tremendously simplifies and improve the options we have to secure, filter, implement restrictions or eventually deal with our data over certain scenarios. What is most relevant for me is that all the security policy can be set centrally at a database level preventing developers from taking care of adding custom where clauses to enforce security. It makes the management of data much more reliable and maintainable.

[More]

Roles for User property in HTTP Current Context

While I was dealing with some potential vulnerability issue affecting to some of "my" MVC 5.0 application in .Net Framework 4.5 and coming from a wrong management of user roles, it turns out that I didn't remember clearly how role management was related to User principal or even, where roles came from in order to IsInRole method were able to work properly to check roles for users. So, let me add this post as a reminder to clarify and shed light on this.

[More]

Provider design pattern at a glance

In a nutshell, the provider model is a design pattern largely used by Microsoft components for allowing an application to make use and choose from multiple implementations of a given contract based on the settings of a configuration file. So, for instance, management of user membership or roles are usually carried out by means of classes based on this pattern (see MemberShipProvider or RoleProvider classes). This way, the application can choose the default provider for dealing with membership or roles, add or remove providers, etc. in a declarative way. It brings a lot of benefits for developers as they can plug new components easily without refactoring code.

[More]

Managing Azure AD Web App sessions with OpenID Connect and Web API access token duration

Some months ago, I came across an unexpected rare issue when dealing with AJAX calls in a MVC Web App that was making use of OpenID Connect (OIDC) protocol to provide authentication on Azure Active Directory (Azure AD). This MVC Web App was set up to call several Web APIs protected by Azure AD authentication too.

You can find more information about this basic scenario made up of a Web App connecting to a Web API here. More in detail, Web APIs were employed in a simple straightforward way as if they were microservices, but this specific point is only for further information, not related to the main issue.

[More]

Simple way of converting elements in a comma delimited string into row values in a SQL table

In my previous article Simple way to get comma delimited values from a field by using SQL I showed how to get a comma delimited string from a field in a SQL table. But, there are other times you want to get the same but the other way around, that is, converting each element in a comma (or another character) delimited string variable into a row value in a table. How to get this, then?

[More]