Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin.
Search for scripts directly from SSMS, and instantly access any saved scripts in your
SSC briefcase from the favorites tab.
Download now (direct download link)
Thank this author by sharing:
By Satish Jayanthi,
There are 3 sections in this script:
1) Create the Date Dimension table
2) Load Data for a specified date range. Supply start and end dates to the variables
@startDate and @EndDate.
3) Update the column "LastDayOfMonth", which I find very useful while doing data analysis.
I use a function called "fnGetLastDayOfMonth" to obtain the last day of a given month.
You need to run the script in the listed order.
Note that the last three columns prefixed with the word "Holiday" are not populated with this script. These fields can be populated at the beginning of each year as you go or you can bulk update with a pre-populated "Holiday" table. I hope you find this script handy.
How to use a variable populated by a script task later in the data flow.
Most of the scripts I've used to populate date dimension uses a cursor. Since data is loaded only on...
Most of the scripts I’ve used to populate date dimension uses a cursor. Since data is loaded only on...
Sometimes we need to check which tables of our database is highly populated. Below is the T-SQL Scri...
Staging table population