You are here: Re: SQL Query question « MsSQL Server « IT news, forums, messages
Re: SQL Query question

Posted by Erland Sommarskog on 07/02/07 21:37

Roy Harvey (roy_harvey@snet.net) writes:
> Pure speculation.....
>
> From your description the process occurs in two steps. The first
> selects the data from T1, the second loads it to T2. That sounds like
> there is an intermediate data store. If the purge of that store
> occurs after the load to T2, and the load to T2 failed, then the file
> or table or whatever was not empty when the next extract from T1
> occurred. If the extract from T1 appends the data it would have been
> appending data that was already there from the failed run.
>
> If the two tables must remain synchronized the extract and load should
> execute within a single transaction.

And to add this: you must also make sure that if any errors occurs during
the transaction, that the transaction is rolled back. For many errors,
execution continues, so if you have error-checking, part of the transaction
will still be committed.

Without seeing the code, speculations is all you can get.




--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация