Aiden Krain
Aiden Krain

Reputation: 17

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

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.

Upvotes: 0

Views: 131

Answers (1)

KarthikBhyresh-MT
KarthikBhyresh-MT

Reputation: 5034

You can try this approach to Implement Fill Down in ADF and Synapse Data Flows

and if in SQL, you can use as below where invoice is the table name

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

Upvotes: 1

Related Questions