Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prime mult var's in 1 Operation

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How can I prime multiple VARIABLES w/ one operation?

declare @sumC1 int, @sumC2 int, @sumC3 int

select sum(C1), sum(C2), sum(C3)
from CUST where cust_id = 123 group by cust_id

THE above SELECT returns clean values; (my real query is much more complex returning a few dozen values)

I'd like to prime VARIABLEs @sumC1 thru @sumC50 w/ in a single operation if possible.. any suggestions are appreciated!!

thx,
BT

 
try something like
declare @sumC1 int, @sumC2 int, @sumC3 int

select @sumC1=sum(C1... John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top