No global profile is configured. Specify a profile name in the @profile_name parameter

Disclaimer:Hey Guys, this post contains affiliate link to help our reader to buy best product\service for them. It helps us because we receive compensation for our time and expenses. 

Note:  Best viewed in Internet Explorer 6 and above

Error: No global profile is configured. Specify a profile name in the @profile_name parameter

Infrastructure: SQL server 2005 and onward

Scenario: Here the scenario was, client was trying to run some stored procedure. In that stored procedure she was calling send_db_mail to send some query result output as attachment like some excel file but sp was breaking during DB mail shoot.


As per the error it tells us that there is no global profile defined and so we should specify a value for @profile_name but overall error was actually misleading. It was something to do with DB mail profile security.

Follow the below steps to check database public profile security:

  1. Go to DB mail configuration wizard
  2. Manage profile security
  3.  Set public profile security to Yes and increase the MaxFileSize to its max value to allow sending big attachment (this can be set to max 2GB when your query output seems to be big in size)

To change database attachment size, refer below link.

Hope this helps!!