Little SQL Server Tricks: Add New Columns With Default Value and Foreign Key
So far, I used separate statements to add a new column to a table, set a default value and add a foreign key relation to another table. However, we can do these 3 steps in one single command:
This little trick can save you a lot of typing and puts everything that belongs together in the same command. I got this trick from a very useful Stack Overflow answer by Steve.