Advertisement
Guest User

Untitled

a guest
Jul 11th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. BEGIN
  2. DECLARE @c INT
  3. SELECT @c = count(*)
  4. FROM foo
  5. WHERE bar = @a_param
  6.  
  7. IF @c < 10 THEN
  8. INSERT INTO foo
  9. (bar)
  10. VALUES (@a_param)
  11. END IF
  12. END
  13.  
  14. SELECT @c = count(*) WITH (TABLOCKX, HOLDLOCK)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement