I am trying to build an xml by using the parameter value for the attribute.
Declare @price int =100
Declare @xml xml = '<Product DiscountPrice= "{sql:variable("@price")}" />'
Select @xml
I get the following error.
Msg 9410, Level 16, State 1,
XML parsing: whitespace expected'
What am I missing here?