sodakotahusker
Programmer
- Mar 15, 2001
- 601
I have two temp tables. One is all the records. The other is a summary of table one where I combine the quanity for similar skus.
create table #tempSkus ([ID] int, ClaimID int, ProductCode varchar(50),
Quantity int, InvoiceNumber varchar(100), ClaimInvoiceID int, ProductID int)
create table #SKU ([ID] int, ClaimID int, ProductCode varchar(50),
Quantity int, InvoiceNumber varchar(100), ClaimInvoiceID int, ProductID int)
update t
set quantity = (select sum(s.quantity)
from #tempskus t
inner join #sku s
on t.productid = s.productid and t.claiminvoiceid = s.claiminvoiceid
group by s.claiminvoiceID,s.productID)
I get an error that t is an invalid object.
How do I can my data consolidated into the new database successfully ??? PS: The first table is being build from an xml string.