![]() ![]() Include more dates in Date dimension, the existing dates are not being replacedĭECLARE DATE = '' -change start date if DATE = -change end date if required ĭeclare int = - Delete leap year records (February 29)ĭelete from FactCurrencyRate where month() = 2 and day() = 29ĭelete from FactProductInventory where month() = 2 and day() = 29Īlter table FactCurrencyRate drop constraint FK_FactCurrencyRate_DimDateĪlter table FactFinance drop constraint FK_FactFinance_DimDateĪlter table FactInternetSales drop constraint FK_FactInternetSales_DimDateĪlter table FactInternetSales drop constraint FK_FactInternetSales_DimDate1Īlter table FactInternetSales drop constraint FK_FactInternetSales_DimDate2Īlter table FactProductInventory drop constraint FK_FactProductInventory_DimDateĪlter table FactResellerSales drop constraint FK_FactResellerSales_DimDateĪlter table FactSurveyResponse drop constraint FK_FactSurveyResponse_DateKey For example: if the current year is 2021, the data after running the script will be from 2017 to 2021.ĭeclare date = DATEADD (dd, -1, DATEADD(yy, DATEDIFF(yy, 0, GETDATE()) +1, 0)) #ADVENTUREWORKS 2012 DATABASE DOWNLOAD UPDATE#AdventureWorksDW original database contains data from 2010 to 2014, ths script will update the data to be (current year - 4 yars) to current year It uses the current year as the last year for the data in the Adventure Works database. The script updates the date colums for the AdventureWorksDW database with recent dates and it inserts new dates in the date dimension. You don’t want to have to explain why the data is old! However, the data is from 2014, making it difficult to showcase demos for stakeholders. The Microsoft AdventureWorks databases are excellent training resources. Why would you want to update your AdventureWorks Database? Why would you want to update your AdventureWorks Database?. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |