![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a problem with a DTS package of Sql Server 2000 (Standard Edition). The package has to import some record from one table to another one and flag them with a X through a lookup query. The problem is that sometime DataPump seems to skip some rows, that are not exported but however flagged with X. If I manually remove the flag from the table then the row was exported..... Where is the problem? Thanks Daniele P.S Sorry for my english..... |
#3
| |||
| |||
|
|
So you export rows from one SQL Server table to another (same DB ?) I export from MSDE to Informix 5.0 through intersolv odbc driver version |
|
based on some lookup value you flag them with an "X". I use a multiphase datapump |
|
Does it always skip the same rows? I try to find some likenesses from the rows... the only coincidence is the |
#4
| |||
| |||
|
|
"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> ha scritto nel messaggio news:enWfSejvDHA.2148 (AT) TK2MSFTNGP12 (DOT) phx.gbl... So you export rows from one SQL Server table to another (same DB ?) I export from MSDE to Informix 5.0 through intersolv odbc driver version 3.11 based on some lookup value you flag them with an "X". I use a multiphase datapump ------Row transform function Function Main() DTSDestination("partita") = DTSSource("partita") DTSDestination("numpro") = DTSSource("numpro") DTSDestination("numset") = DTSSource("numset") DTSDestination("esercz") = DTSSource("esercz") Main = DTSTransformStat_OK End Function ---------On insert success Function updFlagg() DTSLookups("udpFlgagg").Execute DTSSource("esercz"), DTSSource("numset"), DTSSource("numpro"), DTSSource("partita") updFlagg = DTSTransformStat_OK End Function ------ DTS lookup query..... UPDATE Pesate SET flgagg = 'X' WHERE (esercz = ?) AND (numset = ?) AND (numpro = ?) AND (partita = ?) --------DataPump source select * from pesate where flgagg <> 'X' or flgagg is NULL ------- Source table CREATE TABLE [dbo].[Pesate] ( [esercz] [int] NOT NULL , [numset] [int] NOT NULL , [numpro] [int] NOT NULL , [partita] [int] NOT NULL , [classe] [int] NULL , [peso] [float] NULL , [flgagg] [char] (1) NULL , [Orario] [datetime] NULL , [Lotto] [nvarchar] (10) NULL , [Data] [datetime] NULL , [Toelet] [nvarchar] (1) NULL , [Ritoel] [nvarchar] (10) NULL ) ON [PRIMARY] ------Destination Table CREATE TABLE [dbo].[fsuipe] ( [esercz] [decimal] NOT NULL , [numset] [decimal] NOT NULL , [numpro] [decimal] NOT NULL , [partita] [decimal] NOT NULL , [classe] [decimal] NULL , [peso] [decimal] NULL , [flgagg] [varchar] (2) NULL , [Orapeso] [varchar](8) NULL , [Lotto] [nvarchar] (10) NULL , [Dtpeso] [datetime] NULL , [Toelet] [varchar] (1) NULL , [Ritoel] [varchar] (1) NULL ) ON [PRIMARY] Does it always skip the same rows? I try to find some likenesses from the rows... the only coincidence is the time. In general it happens in the morning from 6.00 to 7.00 and in the afternoon after 17.00.... Unfortunately, in this period sql server does nothing of unusual..... Now i have a doubt, can datapump manage a row-by-row process, or it was implemented only for big data transfer? |
#5
| |||
| |||
|
|
select * from pesate where flgagg <> 'X' or flgagg is NULL |
#6
| |||
| |||
|
|
select * from pesate where flgagg <> 'X' or flgagg is NULL I'm sure, because new row in source table have flag set Null at default...... You have also to consider that while the dts work, new records can be inserted in the source table.... In the sorce table are inserted about 6 records for minute...... The strange thing is that the task execution seems to be succesfull.... I try to log the execution of the datapump in the exception file but no error message are recorded.... |
#7
| |||
| |||
|
#8
| |||
| |||
|
|
Thanks Allan for your help, you're very kind. I'll try your solution and then I let you know how it works.... But can you explain me where is the bug in the solution that I devolope? |
#9
| |||
| |||
|
#10
| |||
| |||
|
|
Hi Allan, I've tried your solution. There is some problem. Sometimes the last record that i copy are not flagged with 'X' and so the next run DTS give me an error of duplicate key..... The Dts are strucured : 1 - I create a temporary table with the non-flagged records 2 - I execute the DataPump to transfer data 3 - I execute the update query: UPDATE Pesate SET flgagg = 'X' FROM Pesate INNER JOIN Pesate_temp ON Pesate.esercz = Pesate_temp.esercz AND Pesate.numset = Pesate_temp.numset AND Pesate.numpro = Pesate_temp.numpro AND Pesate.partita = Pesate_temp.partita Do you have some idea? |
![]() |
| Thread Tools | |
| Display Modes | |
| |