I am trying to create a stored procedure that will use a query to extract data in an xml format and output it to a file.
I was hoping for something like this
Set @xml = (Select * from table1 where col1=’test’ FOR XML RAW)
then
echo to a filename using xp_cmdshell
but it will not work.
I know how to do this with vb but i need the code to be in the stored proc.
Can anyone assist me?