Click here to Skip to main content
15,884,750 members
Please Sign up or sign in to vote.
1.33/5 (2 votes)
See more:
insert into scramble
(A1,A2, A3 ,A4 , A5 , A6, A7, A8, A9,A10,A11,A12,A13,A14,A15)
values ('B1','B2','B3','B4','B5','B6','B7','B8','B9','B10','B11','B12','B13','B14','B15');

I GET THIS MESSAGE :
Msg 8152, Level 16, State 14, Line 1
String or binary data would be truncated.
The statement has been terminated.
Posted
Updated 20-Mar-15 10:24am
v3
Comments
Zoltán Zörgő 20-Mar-15 16:17pm    
Besides the fact that it looks nonsense? :)
1) How does the scramble table structure looks like?
2) What RDBMS do you use?

 
Share this answer
 
At least one of your columns is not wide enough for the data you're trying to put into it. My guess is the columns are 2 chars wide - make them 3 chars.
 
Share this answer
 
Comments
PIEBALDconsult 20-Mar-15 17:36pm    
I assume they're one-character wide and he doesn't want apostrophes around his source column names.
Member 11540704 21-Mar-15 6:10am    
thanks everybody!
One or more of the strings you're trying to insert is too long for the column, as per the column length constraint. The simplest way to find out would be to open the Management-Tool of your SQL-Database-System ("Sql Server Management Studio" for SQL-Server) and look at the column definitions of that table "scramble".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900