- Business Intelligence with MicroStrategy Cookbook
- Davide Moraschi
- 345字
- 2021-07-23 15:32:01
Modifying a table structure
Like it or not, database tables change. Due to upgrades in source systems, mergers and acquisitions, or simply because of a shift in the project management, we suddenly find that an SKU or a customer ID is not there anymore. Let alone systems in continuous development where the database seems to have a life of its own and morphs every now and then into different shapes. We all know how difficult it is to go back and test every ETL script and every report to see if they still return reliable data.
Sometimes changes happen without notice, you come to the office on a Monday morning to see that the CFO has a different color…, then you realize that something went wrong.
There is no vaccine for this, other than carefully documenting everything and hope for the best. Let's see how to refresh our table structure information using the Warehouse Catalog window.
Getting ready
You need to have completed the previous recipe and exercises to continue.
How to do it...
First of all, we will modify the structure of the DimDate
table to add a column with the month's description:
- In command prompt type:
sqlcmd -S (localdb)\v11.0 -d AdventureWorksDW2008R2
- Once the
1>
prompt appears, type:ALTER TABLE DimDate ADD CalendarYearMonth VARCHAR(7) go UPDATE DimDate SET CalendarYearMonth = CONVERT(VARCHAR(7), FullDateAlternateKey, 111) go exit
- Now go to the Warehouse Catalog window and right-click on the table
DimDate
in the right pane and select Show Sample Data. - See that there is a new column at the end named
CalendarYearMonth
with the format YYYY/MM. - Click on Close and right-click again on
DimDate
, then select Update Structure. - Now click on Save and Close to exit this window, MicroStrategy will write the changes to the metadata.
- Update the schema.
How it works...
It's very important to keep the metadata consistent with the latest information about the structure of the database, especially when changing the datatypes or when columns are removed from data warehouse tables.
- Managing IaaS and DBaaS Clouds with Oracle Enterprise Manager Cloud Control 12c
- 讓財(cái)報(bào)說話:世界500強(qiáng)CFO帶你輕松讀財(cái)報(bào)(鮮讀版)
- 國(guó)家治理能力視角的國(guó)家審計(jì)功能理論研究
- SAP ABAP Advanced Cookbook
- 大數(shù)據(jù)搜索與挖掘及可視化管理方案 :Elastic Stack 5:Elasticsearch、Logstash、Kibana、X-Pack、Beats (第3版)
- Team Foundation Server 2013 Customization
- 中國(guó)政府統(tǒng)計(jì)問題研究
- Getting Started with Citrix VDI-in-a-Box
- VMware vCenter Operations Manager Essentials
- 新編統(tǒng)計(jì)學(xué)
- 2017年度注冊(cè)會(huì)計(jì)師全國(guó)統(tǒng)一考試專用教材(圖解版):審計(jì)
- 中國(guó)審計(jì)市場(chǎng):制度變遷與競(jìng)爭(zhēng)行為
- 計(jì)量經(jīng)濟(jì)學(xué)
- Force.com Tips and Tricks
- Hyper-V Best Practices