kallem
kallem

Reputation: 811

Error when using openrowset for particular record

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

While executing the above query, I am getting following error:

Msg 8152, Level 16, State 10, Line 1
String or binary data would be truncated. The statement has been terminated.

Can anyone help me to resolve this?

Upvotes: 0

Views: 841

Answers (1)

gbn
gbn

Reputation: 432742

You will have to check the source data against the target column definitions.

This happens when you try to insert, say, 100 characters into a varchar(50) column

Upvotes: 1

Related Questions