Page 1 of 1

Reading and Writing in same table

Posted: Thu Jul 21, 2016 11:32 am
by mallikharjuna
Hi All,

I have to read and write data in same table with timeId change we have to append same records in table. could you please let me know it is possible in same job without having locks and other issues. i am using sql server database.

Thanks
Mallikharjuna Reddy

Posted: Thu Jul 21, 2016 4:04 pm
by ray.wurlod
Almost certainly NO.

This is what is called a "blocking operation", and would thwart pipeline parallelism, so it is banned in parallel jobs.

It may be possible, provided that the writing stage uses auto-commit, and the reading stage is far enough downstream for the commits to have taken effect. But I don't really recommend this approach.

Server jobs can use blocking operations.

Posted: Thu Jul 21, 2016 5:52 pm
by SURA
Job1 - Read and write it in a file.
Job2 - Insert / Update

Posted: Thu Jul 21, 2016 6:59 pm
by ray.wurlod
SURA wrote:Job1 - Read and write it in a file.
Job2 - Insert / Update
Which part of "in same job" wasn't clear? :?

Posted: Thu Jul 21, 2016 7:08 pm
by SURA
Same thought as like you guys have, but rather than saying that, given an option to use it :lol: