daakidz.blogg.se

Sql server sp send dbmail file attachment
Sql server sp send dbmail file attachment









sql server sp send dbmail file attachment

Here, I’ve included a number of options that you might find useful when sending query results as an email attachment. Here’s another example that expands on the previous one. EXEC = 'DB Admin = ' = 'Potential candidates for an Admin job, = 'SELECT TOP(5) * FROM = 'Query results as discussed' More Options You also have the option of providing your own name for the attachment. The name was automatically generated by Database Mail.īy default, the maximum file size for attachments is 1 MB per file, but you can change this with the sysmail_configure_sp stored procedure. This example sends an email with the results attached as a. EXEC = 'DB Admin = ' = 'Potential candidates for an Admin job, = 'SELECT TOP(5) * FROM = 'Query results as discussed'

sql server sp send dbmail file attachment

To send the results in an attachment, simply provide a 1 for this argument. This is accepts a bit value, with the default being 0 (for no attachment). To attach those results as an attachment, use the argument.

sql server sp send dbmail file attachment

To email the results of a query, use the argument. One of the choices you have when executing this procedure is whether or not to include the results of a query.Īnother choice you have is whether or not to send those results in an attachment. In SQL Server, you can send emails using the sp_send_dbmail stored procedure in the msdb database.











Sql server sp send dbmail file attachment