Skip to content

Instantly share code, notes, and snippets.

@zafergurel
Created April 1, 2020 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zafergurel/84d1b0a58b44306840df39ad300c1ffe to your computer and use it in GitHub Desktop.
Save zafergurel/84d1b0a58b44306840df39ad300c1ffe to your computer and use it in GitHub Desktop.
test sql server cores
USE master
SELECT MyInt = CONVERT(BIGINT, o1.object_id) + CONVERT(BIGINT, o2.object_id) + CONVERT(BIGINT, o3.object_id)
INTO #temp
FROM sys.objects o1
JOIN sys.objects o2 ON o1.object_id < o2.object_id
JOIN sys.objects o3 ON o1.object_id < o3.object_id
SELECT SUM(CONVERT(BIGINT, o1.MyInt) + CONVERT(BIGINT, o2.MyInt))
FROM #temp o1
JOIN #temp o2 ON o1.MyInt < o2.MyInt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment