I have a table variable named @MatchTemp.I have written an insert query using select statement as shown below
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.
How can i write the update query instead of Insert as shown above? Im stuck here
Update @MatchTemp set StoreName=s.StoreName,CompanyCode=co.CompanyCode,..
from Cashsafes c
Any help will be appreciated.