• In brief here is what I have

    A variable number of tables, each of them have field names ID and Index0, they each also have 1-3 data fields. I need to delete rows from each of these tables where the data fields are all nulls.

    The issues is:

    1- the tables have up to a billion rows or even more of which I would say on average 60% need to get deleted, so we need to do this in batches or using a cursor (which we currently use), but the cursor is 4 times slower when running through SSIS that running it straight through SQL.

    I would prefer building this into SSIS somehow as all the other steps of the ETL process runs perfectly through SSIS

    In our dynamic scriptwe get a list of the tables that have those field names and the second part then gets the actual field names, the cursor then uses this in combination with a search of the field values for the data columns to delete the rows.

    In effect Delete from Table A where Datafield1 is null and Datafield2 is null - the issue here is that the table may have one, two or three data fields.

    I hope this makes sense.