Kasper Hansen
Kasper Hansen

Reputation: 6547

string or binary data would be truncated - but don't know parameter values

The company program prints out the string or binary data would be truncated error to an error table when trying to insert into a specific table. I do realize from other posts that the cause of this is the current table structure. There are one or more fields that are too short, but unfortunately I do not have access to the values of the actual query. Instead, it dumps them as @parametername1, @parametername2, etc. from the stacktrace.

Is there any way I can see from some kind of monitoring tool in SQL Server 2012 what parameter and value failed? I mean, the SQL Server has returned the error, so supposedly I can log it if I repeat the error?

Upvotes: 0

Views: 188

Answers (1)

Chris H
Chris H

Reputation: 545

You can setup a trace in SQL Profiler. For the statement, it will give you list of columns and matching values being inserted.

Upvotes: 2

Related Questions