Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Truncated SQL Data error

Status
Not open for further replies.

Bwintech

Programmer
Jan 25, 2002
25
GB
Hi,

I wrote a SQL script that imports a list of names into a new table then loops through that list and updates their relevant columns based on a series of select and update statements.

It works perfectly when I run it from SQL Query Analyser.

I have tried to now run it as a stored procedure or even as a DTS package but I get a SQL SERVER ERROR detailing that the string or binary data is getting truncated. The process is then quit with failure.

I would greatly appreciate any help or guidance in troubleshooting this problem

Kind regards

Brett
 
SQL Server is really finicky about inserting or updating a char/varchar field with text that is longer than the field definition. If you can't (or don't want to) prevent the string from being too long before putting it in the table, then use LEFT() on the value just before. I assume (danger Will Robinson) that the fact that you have had success from the query analyzer is because you had clean data for one reason or another versus when you exec the sp or dts. JHall
 
My users get this error when they enter data that is longer than the field length. BeckahC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top