Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. CKG Edit ====== ====== ===== Explanation of SQL ===== Sets the ShippingAddressID in the TransDetail table to the correct ID using the ShippingAddressLinkID. This query is automatically ran in versions 04.50.1012.1701 and later during an update for the TransDetail table (Table version 44). ===== Risk of Data Corruption if Run Improperly ===== **High**. Data is modified in this query. Do not run this except under the direction of a Cyrious Technical Support staff member. Doing otherwise may result in lost or contaminated data. All data modifications done through direct SQL **are permanent and non-reversable**. ===== SQL ===== <code sql> UPDATE TransDetail SET ShippingAddressID = Al.AddressID , ModifiedDate = GETDATE() , ModifiedByUser = 'Correct ShippingAddressID' FROM TransDetail TD WITH(NOLOCK) LEFT OUTER JOIN TransHeader TH ON TH.ID = TD.TransHeaderID LEFT OUTER JOIN AddressLink AL WITH(NOLOCK) ON Al.ID = TD.ShippingAddressLinkID WHERE Al.AddressID TD.ShippingAddressID AND AL.ID IS NOT NULL AND TD.ShippingAddressID IS NOT NULL AND TH.TransactionType in (1,6) and TH.StatusID in (1,2,3) </code> ===== Version Information ===== * Entered : 12__/14__/2010 * Version : 04.50.1012.1701+