Home Forums SQL Server 7,2000 SQL Server Agent Msg 8152, Sev 16: String or binary data would be truncated. [SQLSTATE 22001] RE: Msg 8152, Sev 16: String or binary data would be truncated. [SQLSTATE 22001]

  • Hi,

    I just had the same issue and it was caused by a trigger that stores all updates in an audit table. The audit table stores some additional information as SUSER_SNAME and APP_NAME ...

    After adding substring function the problem was solved

    SUBSTRING(APP_NAME(), 1, 50)

    APP_NAME() in ssms is about 47 characters but when you execute via a job it returns SQL AGENT .... + a guid ... which is longer than 50 chars.

    Kind regards

    Peter.