Below are my code. While running below code i am getting error
Msg 9413, Level 16, State 1, Line 2
XML parsing: line 1, character 33, A string literal was expected
if object_id('tempdb..##DataSource') is not null
begin
drop table ##DataSource
end
CREATE TABLE ##DataSource
(
ParameterValue bigint,
Source nvarchar(100)
)
DECLARE @XMLStringDataSource XML = '<ROOT><data><row ParameterValue=\"12345678\" Source=\"Intake\"/><row ParameterValue=\"44444444\" Source=\"Intake\"/> </data></ROOT>'
INSERT INTO ##DataSource (ParameterValue,Source)
SELECT
ParameterValue = XTBl.XCol.value('@ParameterValue','bigint') ,
Source = XTBl.XCol.value('@Source','nvarchar(100)')
FROM @XMLStringDataSource.nodes('ROOT/data/row') XTbl(XCol)