Do not use this feature. This feature has been replaced by sp_describe_first_result_set (Transact-SQL), sp_describe_undeclared_parameters (Transact-SQL), sys.dm_exec_describe_first_result_set (Transact-SQL), and sys.dm_exec_describe_first_result_set_for_object (Transact-SQL).
But don't you see...it is the Microsoft tools such as SSIS and SSRS that are the ones using the old FMTONLY...and not the author of the article. Until Microsoft (and other vendors) stop using FMTONLY to inspect metadata, we all need to understand and use FMTONLY...as Gerald so nicely did in this article.
This is trick:
IF 1 = 0 SET @FMTONLY... is neat, and makes perfect sense once you understand that with FMTONLY EVERY conditional branch is taken. (Of course understanding this behavior is important if you have other conditional branches in your code, as I describe in my article Dealing with the Evil of FMTONLY from SSRS[/url] )
Another way of detecting that FMTONLY is set is to test for:
IF @@OPTIONS IS NULL
Great article, Gerald. Thanks for sharing!