已解决! 转到解答。
通过翻阅:https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x5PYCAY&l=en-US 已经知道不设置条件为何只能查出几条数据的原因了:IntInterval specifies the query value sample rate. IntInterval can range from 10 ms to several years. IntInterval defaults to 1 (one day). WEEK is a standard seven days, but MONTH and YEAR account for different month lengths and leap years. 默认采集频率为1天
但是新的问题来了:
参考http://https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x5PYCAY&l=en-US 的例子:
select LocalTime,"NB-CAOBING-K245/未命名库 3/FDWD"
from [CITADEL].[SCHEMA].[NICIT].[IntData]
where IntInterval='00:00:1'
提示转换错误:
Msg 402, Level 16, State 1, Line 5
The data types ntext and varchar are incompatible in the equal to operator.
使用convert()都无法转换,尝试很多办法都无法转换
做了很多尝试:
1. SQL Server Linked Server方式仍然存在转换问题;
2.Java使用ODBC驱动,查询没问题;
3.用DbVisualizer 工具查询也没问题;
基本能确定是Linked Server的问题导致,刚好我们评估Linked Server方式太占资源,放弃这种连接方案,转而采用其他两种方式做解决方案,所以这个问题不在深究了!