SQL Server - Select inserted rows in a table, inside THE SAME transaction -


i need confirmation 1 "tricky" question. in transaction, in insert rows in table. after that, querying same table, , based on results, insert in table.

my question is: inserted rows in first table visible when inserting in second table? (i need inserted rows visible).

my first insert :

insert biousers select newid(),a.badgenr,getdate(),a.persnr         (             select cb.persnr,c.badgenr curbiodistribution cb                  inner join cur c on c.persnr = cb.persnr                                       cb.[type] = 1                      , cb.groupnr = @nr                      , cb.persnr in (select persnr curbiodistribution groupnr = @nr)                      except (select persnr, badgeid badgenr biousers)             )  

i want insert biouserid's in first table in table, contains field biouserid, if not in it. when select first one, want inserted rows too.

ps: searched problem, find answers issue when multiple transaction (from different clients) involved.

if both inserts in same transaction, yes. if not in described multi-user scenario. multi user infact misleading, multi transaction more correct.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -