DF015: The SET FMTONLY statement is used.
Last modified: May 28, 2025
The topic describes the DF015 T-SQL code analysis rule.
Category
DEPRECATED
Message
The SET FMTONLY statement is used.
Description
The SET FMTONLY statement is deprecated. Use the sp_describe_first_result stored procedure instead.
Noncompliant code example
CREATE OR ALTER PROCEDURE dbo.SelectUserData
AS BEGIN
SET NOCOUNT ON;
SELECT * FROM dbo.UserData ud
END;
GO
SET FMTONLY ;
GO
EXEC dbo.SelectUserData
GO
SET FMTONLY OFF;
GO
SET FMTONLY ON;
GO
SELECT * FROM sys.columns
GO
SET FMTONLY OFF;
GO
Compliant solution
EXEC sp_describe_first_result_set @tsql = N'exec dbo.SelectUserData'
GO
EXEC sp_describe_first_result_set @tsql = N'select * from sys.columns'
GO
Was this page helpful?
Want to find out more?
Overview
Take a quick tour to learn all about the key benefits delivered by dbForge Studio for SQL Server.
All features
Get acquainted with the rich features and capabilities of the tool in less than 5 minutes.
Request a demo
If you consider employing this tool for your business, request a demo to see it in action.