我在SSMS' 17中运行以下查询:
select gc.TEXT
from GENERATED_CAMPS gc
where gc.Identifier = '60272747'
and gc.TEXT like '%your%'
结果是一个空白单元格。在where子句中,我指定它必须包含单词your
。这可能表明我的SSMS中存在编码问题吗?
我尝试了什么?
编辑: 这是相关字段的列定义:
Column_name Type Computed Length Prec Scale Nullable TrimTrailingBlanks FixedLenNullInSource Collation
TEXTSMS nvarchar no 510 yes (n/a) (n/a) SQL_Latin1_General_CP1_CI_AS
更新保存到.rpt给出:
" S a v o r y o r 1 1 9 5 2 7#7 6"(简短)
以及其他各种措施:
select gc.TEXT COLLATE SQL_Latin1_General_CP1_CI_AS
, PATINDEX('%your%', gc.TEXT) 'patindex'
, LEN(gc.text) 'length'
, CONVERT(varchar(MAX), gc.TEXT) 'convert'
, cast(gc.TEXT as nvarchar) 'cast'
, CAST( CAST(gc.TEXT AS VARBINARY) AS varchar) 'Cast cast'
from GENERATED_CAMPS gc
where gc.Identifier = '60272747'
and gc.TEXT like '%your%'
给出:
(No column name) patindex length convert cast Cast cast
14 67
还尝试将我的Results to Grid
更改为'Arial Unicode MS'为here