Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

multi queries result to different excel sheets Expand / Collapse
Author
Message
Posted Monday, January 19, 2009 12:52 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, February 19, 2013 1:04 AM
Points: 1, Visits: 54
Hi,
I have three different queries and should get populated to three different excel sheets in the same excel work book...

i was able to send 3 queries result to single excel sheet using sp_send_dbmail
code:

EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'PMDBOSW',
@recipients = 'nswetha03@gmail.com',
@query ='set nocount on; exec dbo.SEND_THIS_MAIL; set nocount off;',
@subject = 'Work Order Count',
@attach_query_result_as_file = 1,

@query_attachment_filename ='D:\SWETHA.XLS' ;

SEND_THIS_MAIL is a proc which returns the multi query result set.


let me know the procedure if it can be done......
Post #639119
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse