|
对于以下值@nReservationID:
% ~, S3 b6 P8 x4 o1 N% C! YSELECT @phoneNumber=- }; f& {9 Z. B& A; f) w
CASE
% N4 e/ f9 ]3 [4 y WHEN ISNULL(rdg2.nPhoneNumber ,0) = 0 THEN ISNULL(rdg2.nMobileNumber, 0)7 \: A6 f% s+ z3 a5 z6 e
ELSE ISNULL(rdg2.nPhoneNumber ,0)3 m. z1 y* S+ B* R \6 S( c
END 1 P: v, O; y! N W: Y
from tblReservation_Details_Guest rdg2 % s+ D$ r) U8 E# i5 T
where nReservationID=@nReservationID+ d, f! F, [, _
为什么会出现此错误?
% ?" \8 I1 {) v* ~7 t' M( M
1 Z! |2 S( W, D消息248,级别16,状态1,过程USP_CRE_WEB_MEMBER_AUTOGENERATEDECV,行136
1 c& m- X6 X" j7 x! M& w3 Cvarchar值‘08041159620’的转换溢出了int列。 L# F% Q+ y" m5 g2 s9 h* f
" }4 k- k: y! ?; Y2 ]0 f( f
7 i( z0 Y' F0 T" T: T7 g解决方案:
+ _2 p! Z& g& M$ b , n7 `9 }, Q0 u& E" v8 E3 l. Z# O
6 n3 [, f3 C( y7 N/ B& E# z$ o9 @9 K! P8 g) K& u- O. r# r
谢谢拉维和其他用户....尽管如此,我已经找到了解决方案" U& U1 B) }: b9 I* w
SELECT @phoneNumber=6 W1 W! g& {9 i# m) }* K0 W( q
CASE
; L( Z/ I2 `; |- U0 ?2 x WHEN ISNULL(rdg2.nPhoneNumber ,'0') in ('0','-',NULL): x+ g' o% {! o$ Q1 D) o
THEN ISNULL(rdg2.nMobileNumber, '0')
# }3 y; m) }# t3 k) }: F6 r" y WHEN ISNULL(rdg2.nMobileNumber, '0') in ('0','-',NULL), V5 h) x+ _7 T$ @
THEN '0'
, N* M6 g* F0 r% C' ~) G ELSE ISNULL(rdg2.nPhoneNumber ,'0')
" K+ {" d6 E$ ?; _! q: p5 \4 rEND
9 }# R) x, r9 D' s5 T1 a" ~ C" }0 vFROM tblReservation_Details_Guest rdg2
1 d) ?1 [" G* m+ u% v+ G8 |3 kWHERE nReservationID=@nReservationID
! v, [' v, L' `9 [+ C只需输入“ 0”而不是0 |
|