@T.Zacks , Welcome to Microsoft Q&A, based on my test, I reproduced your problem.
I tried the following code and it could return auto id.
SELECT 'AAPL',Section,'I' AS Action,
ROW_NUMBER() OVER ( PARTITION BY SectionID ORDER BY InsertedOn DESC) RowNum,
GetDate() AS InsertedOn,'ADM' AS InsertedBy FROM
(
SELECT d.v.value('(Section/text())[1]', 'VARCHAR(MAX)') AS Section
FROM @xml.nodes('/root/SectionLineItemDto') AS d(v)
) X
inner join tblSectionTemplate on tblSectionTemplate.TickerID='AAPL'
Result:
Best Regards,
Jack
If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.