2

String or binary data would be truncated在尝试执行时出错

Insert into Student_info (StudentId,FirstName,LastName,DOB,StudentAddress,StudentEmail,StudentMobile) 
                         (Select StudentId,FirstName,LastName,DOB,Address,EmailId,Mobile from Student_temp where StudentId='" & studentid & "')

表结构Student_Temp

这里

表结构Student_Info

这里

需要帮忙 !!

4

1 回答 1

3

当您尝试将字符串或二进制数据插入到没有足够宽度容纳它的列中时,SQL Server 会报告此错误,例如

create table MyTable
(
    Column1 VARCHAR(10)
)

insert into MyTable (Column1) VALUES ('1234567890A')

Msg 8152, Level 16, State 14, Line 1
String or binary data would be truncated

猜测,这是因为你Student_info.StudentMobilevarchar(10)Student_temp.Mobile is varchar(50)

于 2012-07-20T05:19:37.077 回答