Skip to content

Instantly share code, notes, and snippets.

@Codesleuth
Created January 28, 2016 10:47
Show Gist options
  • Save Codesleuth/3be7eafcae48e42352cc to your computer and use it in GitHub Desktop.
Save Codesleuth/3be7eafcae48e42352cc to your computer and use it in GitHub Desktop.
SQL Server Create Incrementing List
DECLARE @s VARCHAR(8000)
SELECT @s = COALESCE(@s + ',', '') + '@Thing' + CONVERT(nvarchar,[number])
FROM [master].[dbo].[spt_values]
WHERE [name] is null and [number] between 0 and 197
SELECT @s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment