Skip to content

Instantly share code, notes, and snippets.

@meganmcchesney
Created February 20, 2013 21:03
Show Gist options
  • Save meganmcchesney/4999593 to your computer and use it in GitHub Desktop.
Save meganmcchesney/4999593 to your computer and use it in GitHub Desktop.
insert weights from PartPackage to PartAttribute where PartAttribute.field = 'weight' is null
use CurtDev
INSERT INTO PartAttribute (partID, value, field)
SELECT partID, weight, 'Weight'
FROM PartPackage
WHERE PartPackage.partID IN (
/*the group of partIDs to update*/
SELECT partID
FROM Part
WHERE partID NOT IN
(SELECT partID
FROM PartAttribute
WHERE field = Upper ('WEIGHT')))
order by partID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment