Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. MERGE INTO NetworkElementAttributeTypes AS Target
  2. USING (VALUES
  3. (49, N'Lower Leakage limit', 2),
  4. (48, N'Upper Leakage limit', 2)
  5. )
  6.  
  7. AS Source ([NetworkElementAttributeTypeId], [NetworkElementAttributeTypeName], [AttributeDataTypeId])
  8. ON Target.[NetworkElementAttributeTypeId] = Source.[NetworkElementAttributeTypeId]
  9. -- update matched rows
  10. WHEN MATCHED THEN
  11. UPDATE SET [NetworkElementAttributeTypeId] = Source.[NetworkElementAttributeTypeId],
  12. [NetworkElementAttributeTypeName] = Source.[NetworkElementAttributeTypeName],
  13. [AttributeDataTypeId] = Source.[AttributeDataTypeId]
  14. -- insert new rows
  15. WHEN NOT MATCHED BY TARGET THEN
  16. INSERT ([NetworkElementAttributeTypeId], [NetworkElementAttributeTypeName], [AttributeDataTypeId])
  17. VALUES ([NetworkElementAttributeTypeId], [NetworkElementAttributeTypeName],[AttributeDataTypeId]) ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement