DATEPART() Function – Day

I am going to advance the number 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. Not only is it important to know when a sales order came in, but we should fulfill the request using some type of queue (LIFO). If if was a stack (FIFO) implementation, the first person may never get his order! Today, I will be exploring the DATEPART() function. This function has 15 different input parameters that can be…

Date/Time Functions – DAY()

I am going to dig in and write another short article or tidbit on Transaction SQL date/time functions. Most, if not all, modern day computer systems collect data which contains dates and times. Not only is it important to know when a sales order came in, but we should fulfill the request using some type of queue (LIFO). If if was a stack (FIFO) implementation, the first person may never get his order! Today, I will be exploring functions that take a datetime variable as input and return an integer…

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…