On an Identity primary key column, when I try to insert records from tableA to tableB, I get the truncated data error. The datatypes of the destination column and the source are the same datatype - int (4) Help??
Are you only inserting into one column? The error is an ANSI warning that the insertion would result in truncated data in a column. This doesn't apply to integer columns so you must have other columns in the insert statement. One or more columns in the source table is longer than the corresponding column in the destination table.
If you don't care about losing data by truncation, you can run the following command before running the Insert statement. This will turn off he ANSI warning, the data will be truncated and inserted.
SET ANSI_WARNINGS OFF Terry L. Broadbent - DBA
Computing Links:
Ah, thanks,I didn'know it was an ansi warning, The Identity field is an Int (4) primary key field. I'm actually appending data and changing the datatypes with cast and convert, the majority of them I'm moving the size of the varchar down to (20) from (50). But I'll experiment with killing the warning.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.