problem
How to update status with wrong length where length after $ on Signature Key not equal length of portion Key depend on groupid ?
I work on SQL server 2012 I face Issue I can't Update Status with 'wrong length message' where length of portion key
not equal length of signature key after $ based on group Id ?
as Example Signature Key ******
create table #Ref
(
SignatureKey nvarchar(50),
GroupId int,
PortionKey nvarchar(50),
Status nvarchar(100)
)
insert into #Ref(SignatureKey,GroupId,PortionKey,status)
values
('*$*$**$***$**$**$*',3,'s',NUll),
('*$*$*$***$*$**$*',4,'s2',NUll),
('*$*$*$***$*$**$*',6,'shd',NUll),
('*$**$*$***$***$**$*',2,'g',NUll),
('*$**$*$***$**$**$*',5,'f',NUll)
Expected result will be:
SignatureKey GroupId PortionKey Status
*$*$**$***$**$**$* 3 s wrong length
*$*$*$***$*$**$* 4 s2 wrong length
*$*$*$***$*$**$* 6 shd wrong length
*$**$*$***$***$**$* 2 g wrong length
*$**$*$***$**$**$* 5 f wrong length
as above first signature key will be status wrong length because Group Id 3 after second $ have length 2 but portion key s
length is 1 because it only character and 1 not equal 2 so length will be wrong length .