-- "Add LA tablerow from file.sql"
-- Add TreeShare link instead of  'Other Source' Links with correct 'Ancestry Source' values
-- One Source at a time
--
-- Import csv file into temp table LAAddRows
-- CSV file has 2 columns - rmID,extID - and no headers.
-- Then Add new LinkAncestryTable rows based on file
--
;
CREATE VIRTUAL TABLE temp.LAAddRows USING csv(filename='C:\Users\Admin\Desktop\RootsMagic\SQL\LAAddRows.csv');

--use new values to update LinkAncestryTable
INSERT INTO LinkAncestryTable
SELECT 
  NULL AS LinkID
  , 2 AS extSystem
  , 4 AS LinkType
  , c0 AS rmID 
  , c1 AS extID 
  , 1 AS Modified  
  , '' AS extVersion
  , 0.0 AS extDate
  , 0 AS Status
  , '' AS Note
  FROM LAAddRows
;
