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

Can DatabaseMail attach a formatted Excel file Expand / Collapse
Author
Message
Posted Tuesday, February 05, 2013 9:23 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 01, 2013 7:40 AM
Points: 5, Visits: 22
my query


USE [AP_ECC]
GO
/****** Object: StoredProcedure [dbo].[ap_ecc_Mail_for_statuslog] Script Date: 02/06/2013 11:03:01 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[ap_ecc_Mail_for_statuslog] as
EXEC msdb.dbo.sp_send_dbmail
@recipients=N'internal@zeroone.com'
,@body='Hi Team,

Please find attached the status log for today.

Please check the status .

Regards,
Reporting team
'
,@subject ='Status Log for Today'
,@profile_name ='Status HDS A'
,@query ='SELECT [TableName]
,[DateLastRun]
,[StartTimeStamp]
,[EndTimeStamp]
,[StatusLastRun]
FROM [ICMRPTSVR].[ICMRPTDB].[dbo].[icmrptdb_statuslog]'

,@attach_query_result_as_file = 1
,@query_attachment_filename ='Status_Log.txt'


my query is attaching txt file i want it as excel type
Post #1416224
Posted Tuesday, February 05, 2013 11:19 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 10:42 AM
Points: 20,460, Visits: 14,086
please don't cross post

http://www.sqlservercentral.com/Forums/Topic1416223-392-1.aspx




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1416253
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse