T sql msg 8152 string or binary data would be truncated


Microsoft SQL Server 3. Sign up with LinkedIn. The problem is that I need to use a generic method which do not know the field length You can use the length variable with the LEFT as stated above to determine where to chop the value.

View April's Free Course. Microsoft SQL Server The tech resource your business needs. The problem is that I need to use a generic method which do not know the field length Are you talking for a particular table or for any table that you are insertin into??

I would write a function for this as it would be the easiest. I'm not sure where you are going with that, but another idea would be to query the field length from syscolumns and store the length in a variable. Microsoft SQL Server 3.

Why wouldn't you edit it on the frontend and stop it from even making it through to the server? Tackle projects and never again get stuck behind a technical roadblock. Microsoft SQL Server 4. Microsoft SQL Server Sign up with LinkedIn.

You can use the length variable with the LEFT as stated above to determine where to chop the value. View April's Free Course. You can also configure warnings off for all the connections by default by using this stored procedure: As Albert and Lowfatspread said you have to turn on this setting when you finish the query.

The best way to do this you have to use import-export wizard or DTS. View April's Free Course. This will truncate before attempting to insert. Are you talking for a particular table or for any table that you are insertin into??

I would write a function for this as it would be the easiest. You can use the length variable with the LEFT as stated above to determine where to chop the value. By clicking you are agreeing to Experts Exchange's Terms of Use.