How can we help you today? How can we help you today?

SYNCH ERROR: [8152] String or binary data would be truncated

I received this message upon starting a synch between two databases, that included insert new rows. What would have caused this error, and does RedGate identify the exact row that was the culprit? It is difficult to tell from the error message.
:?
jkinstlinger
0

Comments

2 comments

  • Robert C
    I might get corrected on this one, but if I remember correctly, this warning is just generated when you perform a sync between two columns, and the destination has a smaller maximum width than the source - such as an nvarchar(10) going to an nvarchar(5).

    I don't believe we check explicitly that data will be truncated (since that could be a very expensive operation if the table has a large number of rows), just that there's the possibility of it happening.

    Hope that helps,
    Robert
    Robert C
    0
  • Brian Donahue
    The reason why this happens is that SQL Server is adhering to the ANSI behavior and not allowing data to be trucnated. Typically this happens in SQL Compare rather than data compare, but here is the workaround:

    Save the synchronization script to a file.
    Add the line SET ANSI_WARNINGS OFF on the line immediately below SET NUMERIC_ROUNDABORT.

    This allows you to truncate columns in SQL Server tables (at your own peril, of course!)
    Brian Donahue
    0

Add comment

Please sign in to leave a comment.