Error .NET Framework error occurred during execution of user-defined routine or aggregate "USP_LOADSPEC": System.Data.SqlClient.SqlException: Invalid column name - when sending an email containing a constituent attribute merge field

When sending an email message containing constituent attribute merge fields, you might encounter the error, "Blackbaud.AppFx.Server.ServiceException: Data could not be saved.  
A .NET Framework error occurred during execution of user-defined routine or aggregate "USP_LOADSPEC": 
System.Data.SqlClient.SqlException: Invalid column name '[ATTRIBUTENAME]_VALUE'.
Invalid column name '[ATTRIBUTENAME]_COMMENT'.
System.Data.SqlClient.SqlException: 
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnectionSmi.EventSink.DispatchMessages(Boolean ignoreNonFatalMessages)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQuerySmi(Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Blackbaud.AppFx.Platform.SqlClr.SQLViewSpecProcessor.ProcessSpec(SQLViewSpec spec, Nullable`1 changeAgentID)
  ---> System.Data.SqlClient.SqlException: A .NET Framework error occurred during execution of user-defined routine or aggregate "USP_LOADSPEC": 
We are currently evaluating this issue for a fix in a future service pack. 

Steps to Duplicate

1) Create a constituent export definition using a constituent attribute/value and constituent attribute/comment field
2) Use that export definition to create an email template in BBIS.
3) Send an email message with attribute fields as merge fields in the email.
4) Send the email message.
5) Notice that the email job fails which the above error in the send status log.

Environment

 Blackbaud Internet Solutions
 4.0
 4.0.178.55

Was this article helpful?