当我尝试执行时,出现字符串或二进制数据将被截断
错误
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
的表结构
需要帮助!!
最佳答案
当您尝试将字符串或二进制数据插入到宽度不足以容纳的列中时,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.StudentMobile
是 varchar(10)
而 Student_temp.Mobile 是 varchar(50)
关于sql - 字符串或二进制数据在 asp.net 中将被截断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11573294/