Export stored procedure result set to Excel in SSMS
i'm using SSMS and attempting to export the results of a stored procedure to a new excel file. The SP accepts an int parameter but I cannot find a way to call it in the query. Latest effort- EXEC sp_makewebtask @outputfile = 'C:\Users\me\Documents\testing.xls', @query = **ExportAsExcel** N'@id' = 123 @colheaders =1, @FixedFont=0,@lastupdated=0,@resultstitle='Testing details' Running the stored procedure results in two tables of data, which I need on separate sheets. Can any of you advise a better way to go about this? It doesn't even need to be automated, I just need to get the correct data.