--Drop Keys (foreign then primary) --Remove Data (truncate) --Insert data --reapply keys (primary then foreign) --drop constraints Alter table Factschedule drop constraint fk_Dimdate Alter table Factschedule drop constraint fk_schedule Alter table Factschedule drop constraint fk_DimRoute Alter table Factschedule drop constraint fk_Dimbus Alter table Factschedule drop constraint fk_DimEmployee Alter table DimEmployee drop constraint Pk_DimEmployee Alter table DimBus drop constraint Pk_DimBus Alter table Dimschedule drop constraint Pk_Dimschedule Alter table DimRoute drop constraint PK_DimRoute Alter table DimDate drop constraint Pk_Dimdate Alter table Factschedule Drop constraint Pk_FactSchedule --truncate tables truncate table Dimbus truncate table dimdate truncate table dimEmployee Truncate table dimroute truncate table dimschedule truncate table factschedule --reinsert the live data Insert into DimEmployee(EmployeeKey, PositionKey, PositionName, EmployeeHireDate, EmployeeHourlyPayRate) Select e.EmployeeKey, p.PositionKey, PositionName, EmployeeHireDate, EmployeeHourlyPayRate From MetroAlt.dbo.Employee e inner join MetroAlt.dbo.EmployeePosition ep on e.EmployeeKey=ep.EmployeeKey inner join MetroAlt.dbo.Position p on p.PositionKey=ep.PositionKey Insert into DimBus(BusKey, BusTypeKey, BustypeDescription, BusTypePurchasePrice) Select b.BusKey, bt.BusTypeKey, BustypeDescription, BusTypePurchasePrice From MetroAlt.dbo.Bus b inner join MetroAlt.dbo.Bustype bt on b.BusTypekey=bt.BusTypeKey Insert into Dimroute(RouteKey, BusRouteZone) Select BusRouteKey, BusRouteZone From MetroAlt.dbo.BusRoute Insert into dimSchedule(BusDriverShiftKey, BusScheduleAssignmentKey, Employeekey) Select BusDriverShiftKey, BusScheduleAssignmentKey, Employeekey From MetroAlt.dbo.BusScheduleAssignment Insert into DimDate(BusScheduleAssignmentDate, BusScheduleYear, BusScheduleMonth) Select distinct BusScheduleAssignmentDate, Year(BusScheduleAssignmentDate), Month(BusScheduleAssignmentDate) From Metroalt.dbo.BusScheduleAssignment Insert into FactSchedule(DimEmployeeKey, DimBusKey, DimrouteKey, DimScheduleKey, DimDateKey, Riders, FaresPerRoute) Select Distinct DimEmployeeKey, DimBusKey, DimrouteKey, DimScheduleKey, DimDateKey, Riders, Riders * FareAmount From MetroAlt.Dbo.BusScheduleAssignment bsa inner join DimEmployee de on de.EmployeeKey=bsa.EmployeeKey inner join dimBus db on db.BusKey=bsa.BusKey inner join Dimroute dr on dr.RouteKey=bsa.BusRouteKey inner join DimSchedule ds on ds.BusScheduleAssignmentKey=bsa.BusScheduleAssignmentKey inner join DimDate dd on dd.BusScheduleAssignmentDate=bsa.BusScheduleAssignmentDate inner join MetroAlt.dbo.Ridership r on r.BusScheduleAssigmentKey=bsa.BusScheduleAssignmentKey inner join MetroAlt.dbo.Fare f on f.FareKey=r.FareKey --reapply the constraints Alter table DimEmployee Add constraint pk_DimEmployee primary key (DimEmployeeKey) Alter table DimBus Add constraint pk_DimBus primary key (DimBusKey) Alter table Dimroute Add constraint pk_DimRoute primary key (DimRouteKey) Alter table DimSchedule Add constraint pk_DimSchedule primary key (DimScheduleKey) Alter table DimDate Add constraint pk_DimDate primary key (DimDateKey) Alter table FactSchedule Add constraint pk_FactSchedule primary key (DimEmployeeKey, DimBusKey, DimRouteKey, DimScheduleKey, DimDateKey) Alter table factSchedule add constraint fk_DimEmployee foreign key (DimEmployeeKey) References DimEmployee(DimEmployeeKey) Alter table factSchedule add constraint fk_DimBus foreign key (DimbusKey) References DimBus(DimBusKey) Alter table factSchedule add constraint fk_DimRoute foreign key (DimRouteKey) References DimRoute(DimRouteKey) Alter table factSchedule add constraint fk_Schedule foreign key (DimScheduleKey) References DimSchedule(DimScheduleKey) Alter table factSchedule add constraint fk_DimDate foreign key (DimDateKey) References DimDate(DimDateKey) Select * from FactSchedule
Wednesday, July 18, 2018
Code for MetroAltDW SSIS
Subscribe to:
Post Comments (Atom)
Existing without the answers to the difficulties you’ve sorted out through this guide is a critical case, as well as the kind which could have badly affected my entire career if I had not discovered your website.Block Chain Training in chennai
ReplyDeleteBlock Chain Training in annanagar
Block Chain Training in pune
Block Chain Training in velachery
Very good brief and this post helped me alot. Say thank you I searching for your facts. Thanks for sharing with us!
ReplyDeleteselenium Training in chennai
amazon web services Training in chennai
Block Chain Training in velachery
This comment has been removed by the author.
ReplyDeleteWow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
ReplyDeleterpa training in chennai | best rpa training in chennai | rpa training in chennai | rpa training in bangalore
rpa training in pune | rpa online training
I simply want to give you a huge thumbs up for the great info you have got here on this post.
ReplyDeleteData Science Training in Chennai | Data Science training in anna nagar
Data Science training in chennai | Data science training in Bangalore
Data Science training in marathahalli | Data Science training in btm
It was worth visiting your blog and I have bookmarked your blog. Hope to visit again
ReplyDeletepython training in velachery
python training institute in chennai
Thank you for allowing me to read it, welcome to the next in a recent article. And thanks for sharing the nice article, keep posting or updating news article.
ReplyDeleteBest Devops Training in pune
Thanks for sharing this coding admin, it is really helpful. Keep update your blog.
ReplyDeleteccna Training in Chennai
ccna Training near me
ccna course in Chennai
ccna Training institute in Chennai
RPA Training in Chennai
DevOps Training in Chennai
Very creativity blog!!! I learned a lot of new things from your post. It is really a good work and your post is the knowledgeable. Waiting for your more updates...
ReplyDeleteBlue Prism Classes in Bangalore
Blue Prism Training Centers in Bangalore
Blue Prism Institute in Bangalore
Blue Prism Course in Bangalore
Blue Prism Training in Mogappair
Blue Prism Course in Annanagar
Amazing Post . Thanks for sharing. Your style of writing is very unique. Pls keep on updating.
ReplyDeleteBest Spoken English Institute in Chennai
Spoken English Course in Chennai
Spoken English Course in Chennai
English Speaking Course in Chennai
Spoken English Training center in Chennai
Spoken English Classes in Anna Nagar
This comment has been removed by the author.
ReplyDeleteAll are saying the same thing repeatedly, but in your blog I had a chance to get some useful and unique information, I love your writing style very much, I would like to suggest your blog in my dude circle, so keep on updates.
ReplyDeleteSelenium training in Chennai
Selenium Courses in Chennai
best ios training in chennai
Digital Marketing Training in Chennai
java coaching in chennai
JAVA Training in Chennai
JAVA Course in Chennai
It is a great post. Keep sharing such kind of useful information.
ReplyDeleteEducation
Technology
This comment has been removed by the author.
ReplyDeleteI am really enjoying reading your well written articles.
ReplyDeleteIt looks like you spend a lot of effort and time on your blog.
I have bookmarked it and I am looking forward to reading new articles. Keep up the good work..
big data courses in bangalore
hadoop training institutes in bangalore
Java Course in Bangalore
Java Training Institutes in Bangalore
Java Institutes in Bangalore
Good think! I appreciate you sharing this post. Your posts is very useful for me. Really thank you!
ReplyDeleteData Science Training in Chennai Adyar
Data Science Course in Annanagar
Data Science Training in Adyar
Data Science Training in Velachery
Data Science Training in Chennai Velachery
Data Science Training in Tnagar
This blog is more effective and it is very much useful for me.
ReplyDeletewe need more information please keep update more.
Selenium Training in Kelambakkam
Selenium Training in Padur
Selenium Training in Ashok Nagar
Selenium Training in Nungambakkam
Great work!!! Your post is too good and it was wonderful concept. Thank you for your sharing.
ReplyDeleteHadoop Training in Bangalore
Big Data Hadoop Training Bangalore
Big Data Hadoop Course in Bangalore
Big Data Hadoop Training in T nagar
Big Data Hadoop Course in Velachery
Big Data Hadoop Training in Omr
Big Data Hadoop Training in Chennai
Thanks for sharing this information admin, it helps me to learn new things. Continue sharing more like this.
ReplyDeleteAppium Training in Chennai
Best Appium Training institute in Chennai
Appium Certification in Chennai
Mobile Appium Training in Chennai
Mobile Appium course in Chennai
Mobile Appium Coaching in Chennai
You are an amazing writer. The content is extra-ordinary. Looking for such a masterpiece. Thanks for sharing.
ReplyDeleteIoT Training in Chennai
IoT courses in Chennai
IoT Courses
IoT Training in Porur
IoT Training in Adyar
Tremendous effort. Mind-blowing, extra-ordinary post. Your post is highly inspirational. Waiting for your future posts.
ReplyDeleteData Analytics Courses in Chennai
Big Data Analytics Courses in Chennai
Big Data Analytics Training in Chennai
Data Analytics Training in Chennai
Big Data Analytics in Chennai
Data Analytics Certification Courses in Chennai
Data Analytics Courses in Velachery
Data Analytics Courses in T Nagar
Great blog, I was searching this for a while. Do post more like this.
ReplyDeleteGST classes in chennai
GST Training institute in chennai
Salesforce Training in Chennai
Angular 7 Training in Chennai
Tally course in Chennai
ccna course in Chennai
Ethical Hacking Training in Chennai
Hacking course in Chennai
Web Designing Training in Chennai
ui ux design course in Chennai
It’s great to come across a blog every once in a while that isn’t the same out of date rehashed material. Fantastic read.
ReplyDeletecloud computing training in chennai | Cloud computing training class in chennai
Clinical sas training in chennai | SAS Training course chennai
ReplyDeleteI have to voice my passion for your kindness giving support to those people that should have guidance on this important matter.
Keep posting...
ReplyDeleteinterview-questions/aptitude/permutation-and-combination/how-many-groups-of-6-persons-can-be-formed
tutorials/oracle/oracle-delete
technology/chrome-flags-complete-guide-enhance-browsing-experience/
interview-questions/aptitude/time-and-work/a-alone-can-do-1-4-of-the-work-in-2-days
interview-questions/programming/recursion-and-iteration/integer-a-40-b-35-c-20-d-10-comment-about-the-output-of-the-following-two-statements
good post....!
ReplyDeleteinplant training in chennai
inplant training in chennai for it.php
panama web hosting
syria hosting
services hosting
afghanistan shared web hosting
andorra web hosting
belarus web hosting
brunei darussalam hosting
inplant training in chennai
very nice....
ReplyDeleteinplant training in chennai
inplant training in chennai for it.php
namibia web hosting
norway web hosting
rwanda web hosting
spain hosting
turkey web hosting
venezuela hosting
vietnam shared web hosting
good....
ReplyDeleteinplant training in chennai
inplant training in chennai
inplant training in chennai for it.php
italy web hosting
afghanistan hosting
angola hosting
afghanistan web hosting
bahrain web hosting
belize web hosting
india shared web hosting
nice....
ReplyDeleteinternship in chennai for ece students
internships in chennai for cse students 2019
Inplant training in chennai
internship for eee students
free internship in chennai
eee internship in chennai
internship for ece students in chennai
inplant training in bangalore for cse
inplant training in bangalore
ccna training in chennai
very nice blogger thanks for sharing............!!!
ReplyDeletepoland web hosting
russian federation web hosting
slovakia web hosting
spain web hosting
suriname
syria web hosting
united kingdom
united kingdom shared web hosting
zambia web hosting
Your code very useful For me..
ReplyDeleteFinal Year Iot Projects Chennai
Latest ieee Paper Titles 2020
Final Year Projects 2020
Final Year Matlab Project Centers Chennai
all information in blog is very useful.
ReplyDeleteFinal Year Iot Project Centers Chennai
Nice post.Awesome blog.Java training in Chennai
ReplyDeleteJava training in Bangalore
Java training in Hyderabad
Java Training in Coimbatore
Java Online Training
Hi, Honestly, it's a Nice Article
ReplyDeleteIf you are looking for the best Cloud Solutions that will be helpful for your business. We provide efficient methodologies for the successful implementation of Cloud computing business solutions | cloud computing companies in Madhapur | Cloud Computing Services in Madhapur | cloud computing companies in Hyderabad | cloud computing services companies in India | cloud computing solutions companies.
Thank you!
MMORPG OYUNLAR
ReplyDeleteinstagram takipçi satın al
TİKTOK JETON HİLESİ
Tiktok Jeton Hilesi
antalya saç ekimi
referans kimliği nedir
instagram takipçi satın al
Metin pvp
instagram takipçi satın al
tül perde modelleri
ReplyDeletesms onay
mobil ödeme bozdurma
Nft Nasıl Alınır
Ankara Evden Eve Nakliyat
trafik sigortasi
dedektör
web sitesi kurma
aşk romanları