Can the Current Source be Changed To a Different Source Based on the Citation?

Quote from Matthew Friend on 2022-06-28, 12:33 amHi Folks:
I tried looking through the SQL files stored on this site but (maybe I missed it) didn't find what I'm looking for.
Background: A couple of years ago I had used FTM to import part of my family tree from Familysearch. FTM assigns a source to each citation called "FamilySearch Family Tree". Of course when you see that listed as a source it means nothing. So, as an example, I have about 1000+ citations under that source that have a citation (Page number in RM8) of:
"United States Census, 1850," database with images, Washington Valentine
What I'd like to do:
Have an SQL statement where I can select all the FamilySearch Family Tree sources in RM8 that have "United States Cenus, 1850" in the citation and change the source for those citations to something like 1850 Federal Census (which in this case already exists). This would sure make converting the 30,000 or so FamilySearch citations in my tree much quicker. Any ideas/help would be appreciated 🙂
On a side note, Am I missing it, or is there no way inside RM8 to change the source a citation is assigned too??
Thank you, Matthew
Hi Folks:
I tried looking through the SQL files stored on this site but (maybe I missed it) didn't find what I'm looking for.
Background: A couple of years ago I had used FTM to import part of my family tree from Familysearch. FTM assigns a source to each citation called "FamilySearch Family Tree". Of course when you see that listed as a source it means nothing. So, as an example, I have about 1000+ citations under that source that have a citation (Page number in RM8) of:
"United States Census, 1850," database with images, Washington Valentine
What I'd like to do:
Have an SQL statement where I can select all the FamilySearch Family Tree sources in RM8 that have "United States Cenus, 1850" in the citation and change the source for those citations to something like 1850 Federal Census (which in this case already exists). This would sure make converting the 30,000 or so FamilySearch citations in my tree much quicker. Any ideas/help would be appreciated 🙂
On a side note, Am I missing it, or is there no way inside RM8 to change the source a citation is assigned too??
Thank you, Matthew

Quote from Tom Holden on 2022-06-28, 9:15 pmI think transferring a subset of the citations of one source to another is feasible and such subset can readily be filtered if the Page field value has been created systematically. The other source must have a template with citation fields identical to the original.
Do the citations contain details right down to the census page number or household or other detail below "United States Cenus, 1850"? I expect they do else they would be pretty useless and that rules out any mass conversion within the RM UI.
I think transferring a subset of the citations of one source to another is feasible and such subset can readily be filtered if the Page field value has been created systematically. The other source must have a template with citation fields identical to the original.
Do the citations contain details right down to the census page number or household or other detail below "United States Cenus, 1850"? I expect they do else they would be pretty useless and that rules out any mass conversion within the RM UI.

Quote from Tom Holden on 2022-06-28, 10:01 pmAssuming there is just one "FamilySearch Family Tree" master source with the citations containing the string "United States Census, 1850" and just one "1850 Federal Census" master source, then a transfer of the citations from one to the other could look like this (you replace the variable denoted by "[...]" with the actual SourceIDs):
UPDATE CitationTable
SET SourceID=[SourceTable.SourceID of the "1850 Federal Census" source]
WHERE CitationID
IN
(
SELECT CitationID FROM CitationTable
WHERE SourceID=[SourceTable.SourceID of the "FamilySearch Family Tree" source]
AND Fields LIKE '%United States Census, 1850%'
)
;Remember, the target "1850 Federal Census" source's template must have the [Page] variable in it and in its sentence template to present the value from the citation's [Page] variable.
Assuming there is just one "FamilySearch Family Tree" master source with the citations containing the string "United States Census, 1850" and just one "1850 Federal Census" master source, then a transfer of the citations from one to the other could look like this (you replace the variable denoted by "[...]" with the actual SourceIDs):
UPDATE CitationTable
SET SourceID=[SourceTable.SourceID of the "1850 Federal Census" source]
WHERE CitationID
IN
(
SELECT CitationID FROM CitationTable
WHERE SourceID=[SourceTable.SourceID of the "FamilySearch Family Tree" source]
AND Fields LIKE '%United States Census, 1850%'
)
;
Remember, the target "1850 Federal Census" source's template must have the [Page] variable in it and in its sentence template to present the value from the citation's [Page] variable.