The Modern Data Warehouse in Azure by Matt How

The Modern Data Warehouse in Azure by Matt How

Author:Matt How
Language: eng
Format: epub
ISBN: 9781484258231
Publisher: Apress


IF OBJECT_ID('Clean.DirtyCSVFile') IS NOT NULL

DROP TABLE Clean.DirtyCSVFile;

CREATE TABLE Clean.DirtyCSVFile

WITH

(

HEAP,

DISTRIBUTION = HASH([OrderNo])

)

AS

SELECT

ISNULL(CAST([ID] AS INT),'0'),

ISNULL(CAST([SkuItemId] AS VARCHAR(18)),''),

ISNULL(CAST([CustomerId] AS INT),'0'),

ISNULL(CAST([OrderNo] AS INT),'0'),

ISNULL(CAST([Quantity] AS INT),'0'),

ISNULL(CAST([Price] AS DECIMAL(10,2),'0'),

FROM [Ext].DirtyCSVFile

OPTION (LABEL = 'Clean.DirtyCSVFile.CTAS');

Listing 4-1A CTAS statement used to load data into a clean area



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.