Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. ALTER TABLE DimCountryCode
  2. ALTER COLUMN CountryNumericCode int NOT NULL
  3.  
  4. ALTER TABLE DimCountryCode
  5. ADD CONSTRAINT PK_DimCountryCodeCountryNumericCode
  6. PRIMARY KEY NONCLUSTERED(CountryNumericCode)
  7.  
  8. ALTER TABLE DimDate
  9. ADD CONSTRAINT PK_DateRelation
  10. PRIMARY KEY NONCLUSTERED(DateRelation)
  11.  
  12. ALTER TABLE DimPowerPlant
  13. ALTER COLUMN Id int NOT NULL
  14.  
  15. ALTER TABLE DimPowerPlant
  16. ADD CONSTRAINT PK_DimPowerPlantId
  17. PRIMARY KEY NONCLUSTERED(Id)
  18.  
  19. ALTER TABLE FactNuclearPowerPlant
  20. ALTER COLUMN Id int NOT NULL
  21.  
  22. ALTER TABLE FactNuclearPowerPlant
  23. ALTER COLUMN CountryNumericCode int NOT NULL
  24.  
  25. ALTER TABLE FactNuclearPowerPlant
  26. ADD CONSTRAINT PK_DFactNuclearPowerPlanttId
  27. PRIMARY KEY NONCLUSTERED(Id)
  28.  
  29. ALTER TABLE FactNuclearPowerPlant
  30. ADD CONSTRAINT FK_CountryNumericCode_DimCountryCode_CountryNumericCode
  31. FOREIGN KEY(CountryNumericCode) references DimCountryCode(CountryNumericCode)
  32.  
  33. ALTER TABLE FactNuclearPowerPlant
  34. ADD CONSTRAINT FK_Id_DimPowerPlant_Id
  35. FOREIGN KEY(Id) references DimPowerPlant(Id)
  36.  
  37. ALTER TABLE FactNuclearPowerPlant
  38. ADD CONSTRAINT FK_DimNppConstructionStartAt_DimDate_DateRelation
  39. FOREIGN KEY(DimNppConstructionStartAt) references DimDate(DateRelation)
  40.  
  41. ALTER TABLE FactNuclearPowerPlant
  42. ADD CONSTRAINT FK_DimNppOperationalFrom_DimDate_DateRelation
  43. FOREIGN KEY(DimNppOperationalFrom) references DimDate(DateRelation)
  44.  
  45. ALTER TABLE FactNuclearPowerPlant
  46. ADD CONSTRAINT FK_DimNppOperationalTo_DimDate_DateRelation
  47. FOREIGN KEY(DimNppOperationalTo) references DimDate(DateRelation)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement