0

I need to execute a query like as given below which contain a dataset in it.

UPDATE <OrderDataset> 
SET FKProduct = P.PKProduct 
FROM <OrderDataset> DS 
INNER JOIN tblCustomer C ON DS.FKCustomer = C.PKCustomer 
INNER JOIN tblProduct P ON C.PKCustomer = P.FKCustomer 
INNER JOIN tblStock S ON S.FKProduct = P.PKProduct 
AND DS.RotationNumber = S.RotationNumber 
AND ISNULL(DS.RotationLineNo,'NULL') = ISNULL(S.RotationLineNo,'NULL') 
WHERE DS.FKProduct IS NULL

Is there any way to implemnt this.

Arion
  • 31,011
  • 10
  • 70
  • 88
Arun Kumar
  • 877
  • 3
  • 13
  • 37

1 Answers1

1

There is no direct way to do this.

You can pass the table inside the dataset as a parameter to sql server stored procedure ans then do the jon in sp. .

how to pass data table as parameter to sp

Community
  • 1
  • 1
Romil Kumar Jain
  • 20,239
  • 9
  • 63
  • 92