Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
sms1_-_repairing_key_violations [2019/04/03 15:05] admin [SQL 2] |
sms1_-_repairing_key_violations [2019/04/03 15:06] (current) admin [Task Information] |
||
|---|---|---|---|
| Line 114: | Line 114: | ||
| <code sql> | <code sql> | ||
| // RETURN Orders that have no line items | // RETURN Orders that have no line items | ||
| - | SELECT " | + | SELECT |
| FROM "Order Database" | FROM "Order Database" | ||
| - | WHERE OrderID NOT IN (SELECT OrderID FROM "Order Details Database" | + | WHERE OrderID NOT IN (SELECT OrderID FROM "Order Details Database" |
| UNION | UNION | ||
| // RETURN Estimates that have no line items | // RETURN Estimates that have no line items | ||
| - | SELECT " | + | SELECT |
| FROM " | FROM " | ||
| - | WHERE OrderID NOT IN (SELECT OrderID FROM " | + | WHERE OrderID NOT IN (SELECT OrderID FROM " |
| + | UNION | ||
| + | SELECT CAST(" | ||
| + | FROM "Order Database" | ||
| + | WHERE OrderID IN (SELECT OrderID FROM "Order Details Database" | ||
| + | UNION | ||
| + | SELECT CAST(" | ||
| + | FROM " | ||
| + | WHERE OrderID IN (SELECT OrderID FROM " | ||
| ORDER BY MissingType DESC, OrderID DESC | ORDER BY MissingType DESC, OrderID DESC | ||
| </ | </ | ||
| Line 139: | Line 147: | ||
| ====== Task Information ====== | ====== Task Information ====== | ||
| - | * Last Updated: | + | * Last Updated: |
| * Created By: Michael Nolan | * Created By: Michael Nolan | ||
| - | * Verified By: | ||
| * Applies in all versions. More common in versions SMS 8.6 and below due to a change in how Keys are handled for orders and estimates in SMS 8.9. | * Applies in all versions. More common in versions SMS 8.6 and below due to a change in how Keys are handled for orders and estimates in SMS 8.9. | ||