Posts

Showing posts from January, 2019

Understanding and working with NULL in SQL Server

Image
Graphic representation of the difference between 0 and NULL Image taken from 9gag.com According to database theory, a good RDBMS must implement a marker to indicate "Missing or inapplicable information". SQL Server implements the lack of value with NULL, that is datatype independent and indicates missing value, so the logical validations are different, this is better known as Three-Valued Logic , where any predicate can evaluate to True , False or Unknown. I see a common error, referring to null like "Null values" but the correct definition of null is "Lack of value" so you must refer to it as null , in singular form. On this post, we will learn how to work with null in SQL Server. Declaring and assigning NULL For working with null, SQL Server engine uses the reserved word NULL to refer to it. It is datatype independent so you just have to assign it to any variable or field, using the equal operator =, as you can see on this example: D

MSSQLTips.com Rookie of the year 2018

Image
You need a lot of hard work for success! 2018 was a good year for me in a lot of areas of my life both personal and professional (the birth of my daughter, my MCSE certification and another MCSA as well, the start of the local PASS Local group, the growth and recognition of this blog, etc). Also, since August 2018, I started writing technical posts for other sites, and one of them is MSSQLTips.com . This is one of the best SQL Server related sites on the world, it contains a lot of technical articles in a "tip" format where you can learn new things or how to fix an issue in your environments. The new year 2019 has come and new opportunities to continue growing, to continue learning and improve your career. I also have started this year with good news, last week I was awarded "Rookie of the year 2018" by MSSQLTips. This award is won by community, peer and site leaders votes, so I am very honored that many people have voted for me, this is a great honor and a

Source Control using Azure Data Studio and GitHub

Image
You can maintain and deploy code easily Source control is a vital part of IT work, since it is used to track changes over software and documents, with two main benefits: having a centralized, up to date copy of all your applications and utilities, and to be able to rollback to a previous stable version in case of a failed deployment. This is perfectly applicable to SQL Server, where you want to have an updated and ready to deploy elsewhere copy of your database objects. There are a lot of source control applications and software, everyone has its pros and cons, but personally, I like to use Git Hub , since it is free to use and since it was recently acquired by Microsoft, support for other products is easier (SQL Server for this case). On this post, I will show you how to implement a source control for a database using GitHub and Azure Data Studio (ADS) . Setting up your machine First of all, you need to have Azure Data Studio installed and running on your machine, an