Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Insert into @MatchTemp(StoreName,CompanyCode,StoreCode,Address,CityState)
- Select s.StoreName,co.CompanyCode,s.StoreCode,s.BuildingName as Address,s.City+','+st.StateName as CityState
- from Cashsafes c
- inner join Stores s on s.StoreId=c.StoreId
- inner join Company co on co.CompanyId=c.CompanyId
- inner join State st on st.StateId=s.StateId
- and c.CashsafeId=@cashsafeid.
- Update @MatchTemp set StoreName=s.StoreName,CompanyCode=co.CompanyCode,..
- from Cashsafes c
- UPDATE @Table1 SET t1.name = t2.name
- FROM Table2 t2
- INNER JOIN @Table1 t1 ON t1.id = t2.id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement