Generally, the term "stored procedure" is used to mean a
piece of SQL code that is stored and run in the database server. It
sounds like what you mean is a ColdFusion Scheduled Task - a piece
of CF code that is run automatically. You can set these up using
either the CF administrator or the <cfschedule> tag. Breaking
up your mailings is a good idea since CF will probably time out if
you try to execute 250,000 mailings at once. You could do something
like this:
1) If unsent records, do:
2) Select X number of unsent records
3) Send mail
4) Update X records as having been sent
You would just have to make sure that you time it correctly,
otherwise you could wind up with 1 process starting before the
other finishes and some people will get duplicate emails.