DEFINITIONS

Definitions More Info.
Definition ID312
TitleSQL
CategorySCRIPT
DefinitionData veri kurtarma
Definition Description-- HATALI KAYIT DUZELTME -- HATALI KAYITLARI BIR TABLOYA INSERT ET --SONRA BACKUPDAN DONULEN ORJINAL KAYITLARI BIR TABLOYA EKLE --ONCE DEMSUNU YAP DECLARE @StokAKHam int DECLARE @StokAKZayi int DECLARE @PlhSiraNo int DECLARE @CommandToExecute VARCHAR(8000) DECLARE UPDATEFIX CURSOR FAST_FORWARD FOR --HATASIZ TABLODAKI KAYITLARI SELECT CEK,IKI TABLODAKI KAYITLARI JOINLEYEREK DUZELTILECEK ALANLARI SEC SELECT O.StokAKHam,O.StokAKZayi,O.PlhSiraNo FROM /*DOGRU KAYIT TABLOSU*/KartStokTakip.dbo.tblPlastikHareket_FIX O INNER JOIN /*HATALI KAYIT TABLOSU*/ KartStokTakip.dbo.tblPlastikHareket_WORKFIX E ON O.PlhSiraNo=E.PlhSiraNo WHERE O.PlastikKodu = 'TEBFVTELC' OPEN UPDATEFIX; FETCH NEXT FROM UPDATEFIX INTO @StokAKHam,@StokAKZayi,@PlhSiraNo WHILE @@FETCH_STATUS=0 BEGIN SET @CommandToExecute='UPDATE KartStokTakip.dbo.tblPlastikHareket' +CHAR(13)+CHAR(10) +'SET StokAKHam='+CONVERT(VARCHAR(50),@StokAKHam)+',' +CHAR(13)+CHAR(10) +'StokAKZayi='+CONVERT(VARCHAR(50),@StokAKZayi) +CHAR(13)+CHAR(10) +'WHERE PlhSiraNo='+CONVERT(VARCHAR(50),@PlhSiraNo) +CHAR(13)+CHAR(10) +CHAR(13)+CHAR(10) PRINT (@CommandToExecute) --exec (@CommandToExecute) FETCH NEXT FROM UPDATEFIX INTO @StokAKHam,@StokAKZayi,@PlhSiraNo END CLOSE UPDATEFIX; DEALLOCATE UPDATEFIX; GO
RecordBycunay
Record Date07-03-2013 11:49:15
Düzenle
Kopyala
Sil