Msg 8152 error during insert

AccessNut

Registered User.
Local time
Today, 00:50
Joined
Jun 23, 2007
Messages
16
I have a permanent table that I'm trying to insert records into from a temp table. The 2 tables are joined by AssetID. My query basically says for an AssetID in the temp table if it is null in permanent table then insert it into the permanent table.

This is the error I get:

Msg 8152, Level 16, State 4, Line 2
String or binary data would be truncated.
The statement has been terminated.


The interesting thing is when I specify in the SQL statement an AssetID to be inserted into the permanent table it goes fine.

Any thoughts on what may be the cause? Thanks.
 
I have a permanent table that I'm trying to insert records into from a temp table. The 2 tables are joined by AssetID. My query basically says for an AssetID in the temp table if it is null in permanent table then insert it into the permanent table.

This is the error I get:

Msg 8152, Level 16, State 4, Line 2
String or binary data would be truncated.
The statement has been terminated.


The interesting thing is when I specify in the SQL statement an AssetID to be inserted into the permanent table it goes fine.

Any thoughts on what may be the cause? Thanks.
Without any further information, the first thing that comes to mind is that the matching Fields between the two Tables are not exactly Equal. Take a look and see if there are any Fields in the Temp Table that are a similar type, but are larger than the Production Fields (like BigInt vs Int, or perhaps Varchar(max) vs. Varchar(16)
 
Thanks, I'll check. Another thing is that the script was working before and then one day it stopped working. I'm trying to track down the server admin to see if anything changed on the server, because as far as I know there has been no change on the data input side (other than getting new records, however the format, tables, etc remain the same).
 

Users who are viewing this thread

Back
Top Bottom