I have a stored procedure that I declared a variable as an output. In this procedure, I need to have multiple select statements. I have no problem creating multiple select statements when they are NOT in the same output, but I cannot get this one figured out.
After the part of the procedure that reads: SET @XmlOutput = (, I would like to add more select statements.
Thank you for your help!
ALTER PROC [dbo].[uspCreateGeoRssFile]
AS
DECLARE @XmlOutput xml
SET @XmlOutput = (
SELECT
CustomerName AS Title, esn, longitude, latitude, Device_Alias AS Description
FROM
LS_Variable_Listing AS item
WHERE
(triggers <> N'No Event Recorded')
AND (CustomerName = N'Hiland Partners, LLC')
ORDER BY timestamp_utc DESC
FOR XML AUTO, ROOT('channel'), ELEMENTS)
SELECT @XmlOutput