Ok, I've done some research and have ruled out I do not want to use the BCP option of exporting an XML file to the file system of a remote computer. Mainly due to the necessity of the xp_cmdshell procedure and the level of individuals that will need access to this.So, with that in mind, does anyone have any suggestions for pushing data from SQL Server to a file in an XML format other than the sp_OA procedures?To provide insight, I have a query similar to this:SELECT <column1>, <column2>, <column3>, <column4>, <column5>FROM <database>.<schema>.<table1> AS T1 LEFT JOIN <database>.<schema>.<table2> AS T2 ON T1.<field> = T2.<field>FOR XML PATH('DocumentName'), ROOT('NodeName'), ELEMENTS XSINIL, TYPEThe code that actually runs this is in it's own stored procedure then I would use code like so to push this to disk:xp_cmdshell 'bcp "EXEC <database>.<schema>.<somestoredprocedure>" queryout "\\REMOTESERVER\SHARENAME\FILENAME.XML" -c -S<database\instance> -T'
This actually worked like a charm. The only caveat is the permissions required to execute xp_cmdshell. I'm simply not comfortable with the options of providing access to the level of users that would need to access and execute xp_cmdshell. So I'd like to find another way to export this data from SQL Server to disk.Any suggestions?