Advertisement
Guest User

aaaa

a guest
Jun 18th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.47 KB | None | 0 0
  1. alter table report.test add CommitedFlag bit default 0;
  2.  
  3.  
  4. --TAB 1
  5.  
  6. insert into report.test (lol) values ('long tx')
  7.  
  8.  
  9.  
  10. WAITFOR DELAY '00:00:10';
  11.  
  12.  
  13. update report.test set CommitedFlag = 1 where lol = 'long tx';
  14.  
  15. --TAB 2
  16.  
  17.  
  18. insert into report.test (lol) values ('short tx')
  19.  
  20. update report.test set CommitedFlag = 1 where lol = 'short tx';
  21.  
  22.  
  23. --TAB 3
  24. select *
  25. from report.test
  26. where id > 2000
  27.   and id < (select min(id) from report.test where CommitedFlag = 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement