The results of my query has 701 rows. but when executing the msdb.dbo.sp_send_dbmail. i am receiving the email in excel sheet but all the rows are not displaying in the excel sheet only top 40 rows are getting displayed. The data is missing in excel sheet.
My query is as below:
DECLARE
@tab char(1) = CHAR(9)
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'admin',
@recipients = 'xxxxxxxxxxxx',
@query = 'SET NOCOUNT ON
EXECUTE [TMS].[dbo].[SearchTickets]
@CustomerId="C5C2594A-29A1-47FC-A284-2F42A1F5D4D3"
,@ProjectId=null
,@CustomerReferenceNumber=null
,@ProblemDetails=null
,@AssignedTo=null
,@AssignedTeamId=null
,@CurrentStatus=null
,@RespondedBy=null
,@ApplicationId=null
,@PriorityId=null
,@DetailedCategoryId=null
,@SubCategoryId=null
,@TicketNo=null
,@CallTypeCode=null
,@CallSourceCode=null
,@ResolvedBy=null
,@ContactName=null
,@Submitter=null
,@ProblemSummary=null
,@AssignedDateGreater=null
,@AssignedDateLesser=null
,@ResolvedDateGreater=null
,@ResolvedDateLesser=null
,@IsResponseOverDue=null
,@IsResolutionOverDue=null
,@Country=null',
@subject = 'Testing',
@attach_query_result_as_file = 1,
@query_attachment_filename='filename.xls',
@query_result_separator=@tab,
@query_result_no_padding=1,
@query_result_header = 1,
@query_result_width = 32767
↧
I am trying to send the results of sqlquery to an email in excel sheet using msdb.dbo.sp_send_dbmail
↧