Click here to Skip to main content
15,902,198 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i write
insert into db1.dbo.table (f1)
select f1
from db2.dbo.table2
get me error
ASM
Msg 8152, Level 16, State 13, Line 1
String or binary data would be truncated.



why?
Posted

That is because the type of the field "f1" of table2 is bigger than the "f1" of the first table.
For example you are inserting a value of type "char(10)" into a field of "char(9)" .
 
Share this answer
 
v2
Comments
faezeh66 20-Aug-11 3:33am    
i cheched them ,all of them is right
1]please check the data type in both table's whether it is var binary or var char both must be varchar or varbinary first thing.

2]please check the range of varchar in both tables they must be same and if you are executing the command through storeprocedure then check the same in store procedure as well.
 
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