INSERT INTO OPENROWSET('MSDASQL', 'Driver=PostgreSQL Unicode;uid=postgres;Server=localhost;port=5432;database=data;pwd=xxx',
'select SanctionId,SchemeType,SchemeCode,CorrigendumStatus,AttendumStatus,yearofPlan,ReceivedDate from tesing WHERE SanctionId = ''-1'' ')
select SanctionId,SchemeType,SchemeCode,CorrigendumStatus,AttendumStatus,yearofPlan,ReceivedDate from testing where SanctionId=1103
执行上述查询时,我收到以下错误:
Msg 8152,Level 16,State 10,Line 1
字符串或二进制数据将被截断。 声明已经终止。
有人可以帮我解决这个问题吗?
答案 0 :(得分:1)
您必须根据目标列定义检查源数据。
当您尝试将100个字符插入varchar(50)列
时会发生这种情况