STEP 1 : Create a table and insert data as shown below
Create table #Territory(ID nvarchar(100), NAME Nvarchar(max), REMOTE_REF_LM_ID Nvarchar(100), TREE_NA