Hello friends,
I am attempting to write the result of two separate subquerries into two separate tabs of a single excel workbook. I only know of a way to write out via bcp and xp_cmdshell to a tab delimited file.
i.e.
exec master.dbo.xp_cmdshell 'bcp "select top 3* from tblSomeTable" queryout "\\MyMachineNetworkName\C$\SomeOutputFile.txt" -c -T -t,'
My problem is that I do not know how to specify the various sheets (i.e. Subquerry1 --> Sheet1, Subquerry2 --> Sheet2) to send my queries's results to. I want to accomplish this within a single Stored Procedure. However, any previous experience or success story with other methodology, such as Crystal Report, is more than welcome.
Thank you in advance and looking forward to all of your comments and suggestions.
-Q
I am attempting to write the result of two separate subquerries into two separate tabs of a single excel workbook. I only know of a way to write out via bcp and xp_cmdshell to a tab delimited file.
i.e.
exec master.dbo.xp_cmdshell 'bcp "select top 3* from tblSomeTable" queryout "\\MyMachineNetworkName\C$\SomeOutputFile.txt" -c -T -t,'
My problem is that I do not know how to specify the various sheets (i.e. Subquerry1 --> Sheet1, Subquerry2 --> Sheet2) to send my queries's results to. I want to accomplish this within a single Stored Procedure. However, any previous experience or success story with other methodology, such as Crystal Report, is more than welcome.
Thank you in advance and looking forward to all of your comments and suggestions.
-Q