Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 tables design

Author  Topic 

creane
Starting Member

11 Posts

Posted - 2003-09-01 : 11:37:29
Hi Ive a design question which I hope people may help me with..
Were using sql server 2000 and we currently have a schedule (coded in a web markup language), running every couple of hours that is starting to become problematic, due to the large number of records (over a million records in the table). The schedule basically
queries the table A which contains emailaddress, name , a status value (numeric - an index on this field).., and a flag field which indicates whether the individual desires mail to be sent etc.
i.e. select info from A where status < max_status_variable and nomail=0

the schedule basically loops through the recordset, retrieving a list of items to be sent to the individual ie. a series of status (another table queried for this information table b ) , sends the mails and updates the initial table A with the new max status (i.e this individual will not be selected in the next schedule) .. Would anybody have any ideas on any better way of designing this (presumably having a dedicated table with just those records of individuals getting mail would be an improvement)..
Any help greatly appreciated
Eric

nr
SQLTeam MVY

12543 Posts

Posted - 2003-09-01 : 14:27:53
>> presumably having a dedicated table with just those records of individuals getting mail would be an improvement
Yep just put the request in this table and delete it when the email is sent.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -