I need to be able update all the rows in Table using information from another Table and a Formula.
EG:
Table #1 (Only has ONE Record)
GoodMails (Int)
BadMails (Int)
Table #2
Tokens (String)
GoodTokens (Int)
BadTokens (Int)
Score (Numeric(18,4)
I only want to read Table 1 ONCE
I then need to Update ALL the Records in Table 2 with a calculation based on the numeric data.
PSEUDO CODE:
Table2.Score = (Table2.BadTokens / Table1.BadMails) / ((Table2.BadTokens / Table1.BadMails) + (Table2.GoodTokens / Table1.GoodMails))
I need to do this with a Stored Procedure with no Parameters passed. Can anyone help?
Brian Gillham
FailSafe Systems
EG:
Table #1 (Only has ONE Record)
GoodMails (Int)
BadMails (Int)
Table #2
Tokens (String)
GoodTokens (Int)
BadTokens (Int)
Score (Numeric(18,4)
I only want to read Table 1 ONCE
I then need to Update ALL the Records in Table 2 with a calculation based on the numeric data.
PSEUDO CODE:
Table2.Score = (Table2.BadTokens / Table1.BadMails) / ((Table2.BadTokens / Table1.BadMails) + (Table2.GoodTokens / Table1.GoodMails))
I need to do this with a Stored Procedure with no Parameters passed. Can anyone help?
Brian Gillham
FailSafe Systems