SQL Server COALESCE System Function: How It Works

Reading Time: 2 minutes The COALESCE system function offers a great way to check expressions for NULL. The syntax for COALESCE is very simple. It looks like this: COALESCE(<expr1>,<expr2>,<expr3>,<expr4>,….<exprN>) As you can see, all we do is outline a comma-separated list of expressions to the function. SQL Server will evaluate each expression, from left Continue Reading

Do you know this FACTOID about Foreign Key Constraints in SQL Server?

Reading Time: 3 minutes There is an interesting factoid you should know when it comes to working with foreign key constraints in SQL Server. Normally, foreign key constraints are linked to a Primary Key column in a parent table Take a look at the following Books and BookSales tables: CREATE TABLE Books ( BookID Continue Reading

How to make a column NOT NULL in SQL Server: Explained with Examples

Reading Time: 3 minutes You may find yourself needing the change the definition of a table or column from time-to-time while working as a database professional. One change you may need to make is changing a column from nullable to non nullable. It may have been decided that we actually don’t want NULL to appear Continue Reading