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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to allow truncates in a procedure

Status
Not open for further replies.

bebblebrox

IS-IT--Management
Aug 9, 2004
39
0
0
US
hi,

i have a procedure which occasionally generates the following error:

Code:
Server: Msg 8152, Level 16, State 9, Line 112
String or binary data would be truncated.
The statement has been terminated.

is there any command I can issue prior to running the script so that such truncations would be allowed?
 
You need to modify your table or variable deffinitions. One of more string or binary fields is smaller than the data you are trying to insert into the field or variable. For example you are trying to put the value 'XXX' into a field that is varchar(2).

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(Not quite so old any more.)
 
what i really want to do is trap that error and insert the record causing it into another table.

doable?

 
never mind, i had an error in my error handling. traping now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top