Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. USE [Cube]
  2. GO
  3.  
  4. DROP TABLE IF EXISTS DimPerson;
  5. GO
  6.  
  7. CREATE TABLE [dbo].[DimPerson](
  8. [personID] [nvarchar](10) NOT NULL,
  9. [personName] [nvarchar](50) NULL,
  10. [birthYear] [int] NULL,
  11. [birthDecade] [int] NULL,
  12. [deathYear] [int] NULL,
  13. [gender] [int] NULL,
  14. [placeOfBirth] [nvarchar](50) NULL
  15. CONSTRAINT [DimPersonPK] PRIMARY KEY CLUSTERED
  16. (
  17. [personID] ASC
  18. ) ON [PRIMARY]
  19. ) ON [PRIMARY]
  20. GO
  21.  
  22. INSERT INTO DimPerson
  23. SELECT personID, personName, birthYear,
  24. birthYear/10 * 10,
  25. deathYear,
  26. gender,
  27. ISNULL(placeOfBirth, 'UNKNOWN')
  28. FROM IntermediateDB.dbo.Person;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement