Date/Time Functions – @@DATEFIRST

I am on the home stretch with my writing of short articles or tidbits on Transaction SQL date/time functions. We already talked about functions like DATEPART() that returns the day of the week as an integer and DATENAME() that returns the day of the week as text. But what is the first day of the week? The default for the US English language is 7, or Sunday. However, this setting differs between countries. Today, I will be talking about @@DATEFIRST, a configuration function which returns the current session value and…

DATENAME() – Sub-second Functions

I am unwavering in my creation of short articles or tidbits on Transaction SQL date/time functions. Most, if not all, modern day computer systems collect data which contains dates and times. Many times you will want to convert the data from one data type to another. Today, I will be exploring the DATENAME() function. This function has 15 different input parameters that can be passed to change the resulting output. In short, the function takes a date part and date/time variables as input returns the part that you want a…

DATENAME() – Time Related Functions

I am unrelenting in my creation of short articles or tidbits on Transaction SQL date/time functions. Most, if not all, modern day computer systems collect data which contains dates and times. Many times you will want to convert the data from one data type to another. Today, I will be exploring the DATENAME() function. This function has 15 different input parameters that can be passed to change the resulting output. In short, the function takes a date part and date/time variables as input returns the part that you want a…

DATENAME() – Date Related Functions

I am untiring in my creation of short articles or tidbits on Transaction SQL date/time functions. Most, if not all, modern day computer systems collect data which contains dates and times. Many times you will want to convert the data from one data type to another. Today, I will be exploring the DATENAME() function. This function has 15 different input parameters that can be passed to change the resulting output. In short, the function takes a date part and date/time variables as input returns the part that you want a…

Surrogate Keys

I recently worked on a project I which I redesigned sales data warehouse as a STAR schema, using daily file partitions, with a automatic sliding window, and applying data compression at the page level. I ended up reducing a 5 terabyte database to less than 750 GB. I will be writing several articles on the lessons that I learned during the process. Today, I want to talk about how surrogate keys can be used to tie the dimension tables to the fact tables. I need to start the talk off…