チェックサムは、プログラムでnullを返しています。また、クエリのみを実行しようとすると..私は得る
Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the varchar value 'Audit C recorded' to data type tinyint.
..これについて私を助けてもらえますか
SELECT CAST(ABS(CHECKSUM(Indicator)) % 450 AS TINYINT) AS Indicator,
CAST(CIndicator AS VARCHAR(100)) AS CIndicator,
CAST(SK_IndicatorL2 AS TINYINT) AS SK_IndicatorL2,
CAST(ABS(CHECKSUM(IndicatorL2)) % 450 AS TINYINT) AS IndicatorL2
FROM ( VALUES ('Alcohol',
'Alcohol',
'Audit C recorded',
'Audit C recorded (excluding screen in 3y prior to start of quarter)'),
('Alcohol',
'Alcohol',
'Community Detox and TH CAT',
'Community Detox and TH CAT'),
('Alcohol',
'Alcohol',
'Follow Up appointment',
'Follow Up appointment'),
('Healthy Lifestyles',
'Healthy Lifestyles',
'HealthyLifestyle-Aged 19-39',
'HealthyLifestyle-Aged 19-39'),
('Healthy Lifestyles',
'Healthy Lifestyles',
'Aged 19-39 - BMI recorded',
'Aged 19-39 - BMI recorded') ) AS Nis (Indicator,
CIndicator,
SK_IndicatorL2,
IndicatorL2)
私はこれをやってみました: SELECT CAST(ABS(CHECKSUM('Audit Crecorded')) % 250 as TinyInt) 適切な整数値を取得します。