ber*_*436 3 sql-server ms-access
我想编写一个访问查询来计算链接的SQL服务器表中的ntext字段中的字符.
在SQL服务器中,我只使用此命令(在访问中不起作用):
select datalength(nTextFieldName) //this command works on sql server but not in access
Run Code Online (Sandbox Code Playgroud)
在访问中,我只能找到len命令,它不能在ntext字段上工作:
select len(nTextFieldName) // access says nText is not a valid argument to this function.
Run Code Online (Sandbox Code Playgroud)
谷歌搜索,我发现一堆帖子说使用len,这给了我一个错误.
命令是什么?
ntext类型不起作用LEN.不推荐使用此特定类型以及其他一些类型:
ntext, text, and image data types will be removed in a future version of Microsoft SQL
Server. Avoid using these data types in new development work, and plan to modify applications
that currently use them. Use nvarchar(max), varchar(max), and varbinary(max) instead. For more
information, see Using Large-Value Data Types.
Run Code Online (Sandbox Code Playgroud)
处理这种情况的最好办法是转换/施放的数据类型为一个工程,如varchar(max)/ nvarchar(max),然后才拿到LEN.
SELECT LEN(CAST(nTextFieldName As nvarchar(max)))
| 归档时间: |
|
| 查看次数: |
34499 次 |
| 最近记录: |