我正在尝试将数据从 SQL Server 插入到链接服务器,但遇到以下问题:
Msg 8114, Level 16, State 11, Line 1
Error converting data type nvarchar to (null).
我的查询是:
INSERT piserver.piarchive..picomp2
(tag, time, value, annotations)
SELECT cast(c.name as nvarchar) as name, convert(datetime, c.started_at) as started_at, c.value, cast(c.log as nvarchar) as log
FROM [database].[dbo].[table1] c
WHERE c.id = 206
前 3 列中没有空值,但即使我从查询中删除最后一列,我仍然遇到空错误。
picomp2 的数据类型有: tag (WString(4000), not null) time (DateTime, not null) value (Variant, null) annotations (Variant, null)
table1 的数据类型都是 varchar,但 value 是 float。