Currently i have a select statement that returns account information and devices. something like this:
SELECT * FROM ACCOUNTS WHERE STATUS='ACTIVE'
Ok, fine that returns all of my active accounts. this result set gives me Device, PortNumber, Account, Units, XrefID now i need to call a second process that pass the Device and PortNumber to get me the final result. so the call looks like this:
EXEC CalcConsumption [DEVICEFROMPREVIOUSQUERY], [PORTNUMBERFROMPREVIOUSQUERY, '12-22-2014','02-15-2015'
whats the best practice to do something like this and how do i go about it?