steve4king
IS-IT--Management
This is mostly an academic question as my application serves it's purpose fast enough..
I'm doing a process to kill some sensitive data that we don't need.
One of the fields I just shrink, truncating the bad data before updating.
Next:
This actually runs fairly quickly in a table with about 1mil records.
Afterwards I want to verify a few things.
I check the structure easily enough, then:
This also runs fairly quickly with my test data. But I was curious if there is a better way to form this.
(Note that there are no indexes on the table, and creating an index just for this task takes as long as the task without an index and provides negligible results.)
I'm doing a process to kill some sensitive data that we don't need.
One of the fields I just shrink, truncating the bad data before updating.
Next:
Code:
Wait Window "This may take a few minutes - TRANLOG Step 2/5" Nowait
REPL SENT WITH "MYNUMS#"+ALLTRIM(INVOICE),ACCOUNT WITH 'XXXXXXXXXXXX'+RIGHT(ALLTRIM(ACCOUNT ),4), ACCT_EXP WITH 'XXXX' FOR !(LEFT(ACCOUNT ,1)$"X*") AND !EMPTY(ACCOUNT )
Wait Window "This may take a few minutes - TRANLOG Step 3/5" Nowait
REPL SENT1 WITH "MYNUMS#"+ALLTRIM(INVOICE),ACCOUNT1 WITH 'XXXXXXXXXXXX'+RIGHT(ALLTRIM(ACCOUNT1),4), ACCT_EXP1 WITH 'XXXX' FOR !(LEFT(ACCOUNT1,1)$"X*") AND !EMPTY(ACCOUNT1)
Wait Window "This may take a few minutes - TRANLOG Step 4/5" Nowait
REPL SENT WITH "MYNUMS#"+ALLTRIM(INVOICE),ACCOUNT WITH IIF(!EMPTY(account ),'XXXXXXXXXXXX'+RIGHT(ACCOUNT ,4),''), ACCT_EXP WITH IIF(!EMPTY(ACCT_EXP ),'XXXX','') FOR SENT != "MYNUMS" and LEN(ALLTRIM(SENT ))>15
Wait Window "This may take a few minutes - TRANLOG Step 5/5" Nowait
REPL SENT1 WITH "MYNUMS#"+ALLTRIM(INVOICE),ACCOUNT1 WITH IIF(!EMPTY(account1),'XXXXXXXXXXXX'+RIGHT(ACCOUNT1,4),''), ACCT_EXP1 WITH IIF(!EMPTY(ACCT_EXP1),'XXXX','') FOR SENT1 != "MYNUMS" and LEN(ALLTRIM(SENT1))>15
This actually runs fairly quickly in a table with about 1mil records.
Afterwards I want to verify a few things.
I check the structure easily enough, then:
Code:
select count(*) from mytable where ((!LEFT(ACCOUNT ,1)$"X*") AND !EMPTY(ACCOUNT )) or ((!LEFT(ACCOUNT1 ,1)$"X*") AND !EMPTY(ACCOUNT1 ))
This also runs fairly quickly with my test data. But I was curious if there is a better way to form this.
(Note that there are no indexes on the table, and creating an index just for this task takes as long as the task without an index and provides negligible results.)