Skip to content

Instantly share code, notes, and snippets.

@pfmoore
Created October 28, 2020 21:35
Show Gist options
  • Save pfmoore/070931c3cafb42bbc6638e1e1509d72a to your computer and use it in GitHub Desktop.
Save pfmoore/070931c3cafb42bbc6638e1e1509d72a to your computer and use it in GitHub Desktop.
DECLARE @PractitionerList TABLE(PracticionerID INT)
DECLARE @PractitionerID INT
INSERT @PractitionerList(PracticionerID)
SELECT PracticionerID
FROM Practitioner
WHILE(1 = 1)
BEGIN
SET @PracticionerID = NULL
SELECT TOP(1) @PracticionerID = PracticionerID
FROM @PractitionerList
IF @PracticionerID IS NULL
BREAK
PRINT 'DO STUFF'
DELETE TOP(1) FROM @PractitionerList
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment