Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save DoubleBrotherProgrammer/239738 to your computer and use it in GitHub Desktop.
Save DoubleBrotherProgrammer/239738 to your computer and use it in GitHub Desktop.
-- define our data table
WITH data( num )
AS
(
-- our value range in a single query
SELECT 0 AS 'num'
UNION
SELECT 512 AS 'num'
UNION
SELECT 1024 AS 'num'
UNION
SELECT 1536 AS 'num'
UNION
SELECT 2048 AS 'num'
)
SELECT TOP 1 num FROM data
ORDER BY NEWID()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment