merhaba aşağıdaki querryi dene ama bence gir clf line dan elle kendin sil
----------------------------------------------------------------------------------------------------------------
------------------ ÇEKSENET NUMARALARI HATALI OLAN KAYITLAR ----------------------------------------------------
----------------------------------------------------------------------------------------------------------------
------- Firma No : _010_02
----------------------------------------------------------------------------------------------------------------
DECLARE @DOC SMALLINT
DECLARE @PORTFOYNO VARCHAR(9)
DECLARE @LOGICALREF INT
DECLARE @SAYI INT
DECLARE CEKSEN_PORTFOYNO_yasak CURSOR FOR
-------------------------------------------------------------------
SELECT
DOC, PORTFOYNO, COUNT(*) "SAYI"
FROM
LG_010_02_CSCARD
GROUP BY
DOC, PORTFOYNO
HAVING
COUNT(*)>1
-------------------------------------------------------------------
OPEN CEKSEN_PORTFOYNO_yasak FETCH NEXT FROM CEKSEN_PORTFOYNO_yasak
INTO @DOC, @PORTFOYNO, @SAYI
WHILE @@FETCH_STATUS = 0
-------------------------------------------------------------------
BEGIN
SELECT @LOGICALREF=MIN(LOGICALREF) FROM LG_010_02_CSCARD WHERE DOC=1 AND PORTFOYNO=@PORTFOYNO
yasak LG_010_02_CSCARD SET PORTFOYNO='H'+SUBSTRING(PORTFOYNO,2,LEN(PORTFOYNO)) WHERE DOC=@DOC AND PORTFOYNO=@PORTFOYNO AND LOGICALREF=@LOGICALREF
-------------------------------------------------------------------
FETCH NEXT FROM CEKSEN_PORTFOYNO_yasak
INTO @DOC, @PORTFOYNO, @SAYI
END
CLOSE CEKSEN_PORTFOYNO_yasak
DEALLOCATE CEKSEN_PORTFOYNO_yasak
----------------------------------------------------------------------------------------------------------------
Merhaba,
Yedek alıp aşağıdaki sorguyu çalıştırır mısınız? Firma ve dönem numaralarını değiştirmeyi unutmayınız
CREATE UNIQUE INDEX [IFFF_DD_CSCARD_I2] ON [dbo].[LG_FFF_DD_CSCARD]([DOC], [PORTFOYNO]) ON [PRIMARY]
----------
Merhaba,
Yedek aldıktan sonra bu işlemleri yapın.
Çek kartları penceresinde aynı portföy numaralı kayıtlar olabilir. Kontrol ve düzeltme için aşağıdaki sorguları kullanın.
----------CEKSENET PORTFOY NUMARALARI TEK OLMAYANLARIN LİSTELENMESİ --------------
SELECT
DOC, PORTFOYNO, COUNT(*) "SAYI"
FROM
LG_010_01_CSCARD (NOLOCK)
GROUP BY
DOC, PORTFOYNO
HAVING
COUNT(*)>1
ÇEKSENET NUMARALARI HATALI OLAN KAYITLAR ----------------------------------------------------
----------------------------------------------------------------------------------------------------------------
------- Firma No : _010_02
----------------------------------------------------------------------------------------------------------------
DECLARE @DOC SMALLINT
DECLARE @PORTFOYNO VARCHAR(9)
DECLARE @LOGICALREF INT
DECLARE @SAYI INT
DECLARE CEKSEN_PORTFOYNO_yasak CURSOR FOR
-------------------------------------------------------------------
SELECT
DOC, PORTFOYNO, COUNT(*) "SAYI"
FROM
LG_010_02_CSCARD
GROUP BY
DOC, PORTFOYNO
HAVING
COUNT(*)>1
-------------------------------------------------------------------
OPEN CEKSEN_PORTFOYNO_yasak FETCH NEXT FROM CEKSEN_PORTFOYNO_yasak
INTO @DOC, @PORTFOYNO, @SAYI
WHILE @@FETCH_STATUS = 0
-------------------------------------------------------------------
BEGIN
SELECT @LOGICALREF=MIN(LOGICALREF) FROM LG_010_02_CSCARD WHERE DOC=1 AND PORTFOYNO=@PORTFOYNO
yasak LG_010_02_CSCARD SET PORTFOYNO='H'+SUBSTRING(PORTFOYNO,2,LEN(PORTFOYNO)) WHERE DOC=@DOC AND PORTFOYNO=@PORTFOYNO AND LOGICALREF=@LOGICALREF
-------------------------------------------------------------------
FETCH NEXT FROM CEKSEN_PORTFOYNO_yasak
INTO @DOC, @PORTFOYNO, @SAYI
END
CLOSE CEKSEN_PORTFOYNO_yasak
DEALLOCATE CEKSEN_PORTFOYNO_yasak