How do I return an empty result set from a procedure using T-SQL?

I think the best solution is top 0 but not using a dummy table. This does it for me

select top 0 null as column1, null as column2.

Using e.g. a system table may be fine for performance but looks unclean.


If you want to simply retrieve the metadata of a result set w/o any actual row, use SET FMTONLY ON.


That is a reasonable approach. Another alternative is:

SELECT TOP 0 * FROM [dbo].[TableName]

If you need column names in the response then proceed with the select TOP 0 * from that table, otherwise just use SELECT TOP 0 NULL. It should work pretty fast :)