Home > OS >  How to copy a value down a column with the same ID? Azure Data Factory
How to copy a value down a column with the same ID? Azure Data Factory

Time:01-29

enter image description here

Ideally I would like to do this within ADF. Is this possible to do within ADF?

Alternatively, can this be done in Azure SQL Database?

Many thanks in advance.

CodePudding user response:

You can try this approach to enter image description here

DECLARE @v nvarchar(max);

UPDATE invoice WITH(TABLOCKX)
SET @v = Invoice_Number = CASE WHEN Invoice_Number IS NULL THEN @v ELSE Invoice_Number END
OPTION(MAXDOP 1);

DECLARE @vd nvarchar(max);

UPDATE invoice WITH(TABLOCKX)
SET @vd = Invoice_Date = CASE WHEN Invoice_Date IS NULL THEN @vd ELSE Invoice_Date END
OPTION(MAXDOP 1);

 
SELECT * FROM invoice;

enter image description here

CodePudding user response:

Here is how you can use data flows in ADF to implement fill down: https://docs.microsoft.com/en-us/azure/data-factory/data-flow-script#fill-down

  •  Tags:  
  • Related