Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. Insert into @MatchTemp(StoreName,CompanyCode,StoreCode,Address,CityState)
  2.  
  3. Select s.StoreName,co.CompanyCode,s.StoreCode,s.BuildingName as Address,s.City+','+st.StateName as CityState
  4. from Cashsafes c
  5. inner join Stores s on s.StoreId=c.StoreId
  6. inner join Company co on co.CompanyId=c.CompanyId
  7. inner join State st on st.StateId=s.StateId
  8. and c.CashsafeId=@cashsafeid.
  9.  
  10. Update @MatchTemp set StoreName=s.StoreName,CompanyCode=co.CompanyCode,..
  11. from Cashsafes c
  12.  
  13. UPDATE @Table1 SET t1.name = t2.name
  14. FROM Table2 t2
  15. INNER JOIN @Table1 t1 ON t1.id = t2.id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement