Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- USE [Cube]
- GO
- DROP TABLE IF EXISTS DimPerson;
- GO
- CREATE TABLE [dbo].[DimPerson](
- [personID] [nvarchar](10) NOT NULL,
- [personName] [nvarchar](50) NULL,
- [birthYear] [int] NULL,
- [birthDecade] [int] NULL,
- [deathYear] [int] NULL,
- [gender] [int] NULL,
- [placeOfBirth] [nvarchar](50) NULL
- CONSTRAINT [DimPersonPK] PRIMARY KEY CLUSTERED
- (
- [personID] ASC
- ) ON [PRIMARY]
- ) ON [PRIMARY]
- GO
- INSERT INTO DimPerson
- SELECT personID, personName, birthYear,
- birthYear/10 * 10,
- deathYear,
- gender,
- ISNULL(placeOfBirth, 'UNKNOWN')
- FROM IntermediateDB.dbo.Person;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement