Advertisement
DataCCIW

Copy Attribute Values from T1 to T2

Aug 24th, 2022
1,534
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.66 KB | None | 0 0
  1. --Copy attribute values from t1 to t2 for a list of people. T2 must have a value in place but you could use bulk update to set an initial value.
  2.  
  3. UPDATE t1
  4.   SET t1.Value = t2.Value
  5.   FROM AttributeValue AS t1
  6.   INNER JOIN (SELECT EntityId, Value FROM AttributeValue av where av.EntityId in (977,2283,2773,5723,8383,9340,9349,9500,9863,9975,9976,10038,10279,11839,16760,17994,19544,20445,21122,21393,23347,24287,25450,26059,27449,27637,28004,28005,29281,29534,31727,31728,32287,32509,33848,34902,36964,37087,37823,38256,39274,41341,44863,47439,48306,50331,50711,53191,53257,55288)
  7. and av.AttributeId = 5870) t2
  8.   ON t1.EntityId = t2.EntityId
  9.   and t1.AttributeId = 5875
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement