We just came across this in an old production stored proc (there is a lot more going on in here, but this is in one leg of its logic). Why would someone ever select top 0 ro
Use this to create a temporary table where the collation of your DB and TEMPDB may differ.
SELECT TOP(0) column INTO #temp FROM [mytable]
Produces a temp table with same collation as my table. This then means
SELECT * FROM #temp T INNER JOIN [mytable] M ON M.column=T.column
Does not fail due to a collation error.