Very Fast Sproc that will updated recrods
Posted on 2005-04-30
I have a tmptable that I import a txt file into. This table may be from 20,000 to 2 million records, this varies by day. What I need to do is flag a flag field on the records in this order : 1.) Check for Duplicate records that came in, 2.) Check a field for a certain value. This is actually just the first 3 digits of the field. I am testing to make sure the phone number is a valid US areacode. The field is simply the 10 digit phone number., 3.) Check to make sure the records that made it this far without being flagged are not in another table. 4.) Serialize the records. (I have an SP to do this currently).
The tmptable has about 173 fields in it, but the two important ones are serialid(this is the key field for the master table I append this data into later) and ophone(this is the phone number field which I need to pass the 4 steps above.
serialid number (15)
tbl2 (Contains about 1 million distinct phone numbers)
The serialize SP is called Seializ. It simply gets the last serial number in the master table and starts with the next number updating each serialid with a number until it hits the eof.
I would like to be able to call this from a VB app that I run. Currently I am using ADO to do all this and it is SLOOOOW!! Any help will be Great!!! Thanks in advance!!