函数方法:length()
PS. select length(DateTimeIn) from wfrecord where ID=56493;--结果: 19
where 用到的字段没创建索引,就不走索引 where field1 like '%abc%'where field1 in ('a','b','c') --in 这3个都不会走索引 ,fgCbiq
Len(S_name)=20
USE Manage
SELECT LEN(S_name) FROM Staff
SELECT syscolumns.length
FROM syscolumns
WHERE syscolumns.id = object_id('表名') and syscolumns.name='字段名'
将上例中的‘表名’和‘字段名’替换为‘Staff ’ 和 ‘S_name ’ 即可。