daily pastebin goal
28%
SHARE
TWEET

Untitled

a guest Oct 15th, 2018 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE TABLE demo(
  2.  id INT,
  3.  name varchar(20)
  4. );
  5.    
  6. insert into demo(id, name)
  7. values
  8. (1, 'alfa'),
  9. (1, 'beta'),
  10. (1, 'gama'),
  11. (1, 'delta'),
  12. (1, 'teta');
  13.    
  14. select * from demo;
  15.    
  16. id  name
  17. 1   alfa
  18. 1   beta
  19. 1   gama
  20. 1   delta
  21. 1   teta
  22.    
  23. DECLARE @counter INT = 15;
  24.  
  25. UPDATE demo SET id = @counter, @counter = @counter + 1 WHERE id = 1;
  26.    
  27. select * from demo;
  28.    
  29. id  name
  30. 16  alfa
  31. 17  beta
  32. 18  gama
  33. 19  delta
  34. 20  teta
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top