6
By making this Internet:
INSERT INTO t_cmo_oit1980_leitura(id_oit_let,id_oit,rx_num, dt_rx)
SELECT (1),
(SELECT id_oit
FROM t_cmo_oit1980
WHERE id_oit = 6574),
(SELECT rx_num
FROM t_cmo_planilha_leitura
WHERE id_xfc = 39517),
(SELECT dt_rx
FROM t_cmo_planilha_leitura
WHERE id_xfc = 39517);
GO
The mistake happens:
Message 8152, Level 16, Status 14, Line 19 String or Binary data would be truncated. The statement has been terminated.
Table t_cmo_planilha_leitura(Origem)
Table t_cmo_oit1980_leitura(Destino)
It may not be related to the data field. The message says "String or binary data would be truncated". You can detail the data types of each target field and source of that query?
– Pagotti
@Pagotti, I will edit the post and put the structure of each table.
– pnet
@Pagotti, you’re right. I mistook Data for Date. I already know what the mistake is. The Origin table comes from an excel spreadsheet and when creating by DTS, it mounts the varchars with 255 and in the target field is varchar(6) and this for the other fields. I will recreate the table and click again. That’s it, change your comment in response so I mark it.
– pnet
@pnet I edited your question to make it more comprehensive. :)
– Marconi