First thought is be sure to run this in a test company / database :-) Also, I presume that you don't care if some of these bad Ship To's were already used and found today in SO Order History, AR Invoice History, etc
I was also wondering how the the 300k records are first identified as needing to be deleted. Maybe instead of importing to set UDF_DELETE = 'Y' and then subsequently deleting, you could while you import just Delete the record / row to begin with and skip the step of setting UDF_DELETE = 'Y'. This could be done in your T-SQL or could be done while V/I importing.
Assuming client has these 300k rows identified in a spreadsheet, then between SSMS and SSIS you could import that into a SQL table. That would let you construct the T-SQL that joins this 300k table to SO_ShipToAddress to ID the rows to delete and then subsequently the AR_Customer rows to blank out Primary Ship To Code.
Alternatively, knowing that you do Scripting, the 300k rows could be SQL imported into a UDT, then you could add a button script on some screen inside MAS that could GetObject to the UDT and AR_Customer_bus to set a blank value to PrimaryShipToCode AND then UDT to SO_ShipToAddress_bus to run the Delete() function. BUT scripting would run slower than T-SQL.
If you're not comfortable with any of that, your plan is just fine as is !!
------------------------------
Alnoor Cassim
Free Agent Developer and Consultant
CallForHelp.biz
Email:
alnoor@callforhelp.bizOrange County, CA
------------------------------