[英]SQL Server 2008 R2: Query MS Access from SQL Server
Want to retrieve records from Access through linked server in SQL Server and need to convert/cast the column with VARCHAR
for some constraint. 想要通过SQL Server中的链接服务器从Access中检索记录,并且需要对VARCHAR
进行转换/转换以获取某些约束。
My attempt: 我的尝试:
SELECT Cola, Colb
FROM MSAccess_LinkedServer...TableName
WHERE CAST([Cola] AS VARCHAR) = 'A123'
Unable to get the result from above query. 无法从上述查询中获得结果。
But when I remove CAST
then I will get the result, but I want to know how to put the cast/convert
. 但是,当我删除CAST
我会得到结果,但是我想知道如何放置cast/convert
。
No casting should be needed for text. 文本无需强制转换。 How about simply: 简单地说:
WHERE [Cola] = 'A123'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.