DF015: The SET FMTONLY statement is used.

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

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Studio for SQL Server.
All Features

All features

Get acquainted with the rich features and capabilities of the Studio in less than 5 minutes.
Request a demo

Request a demo

If you consider employing the Studio for your business, request a demo to see it in action.
Ready to start using dbForge Studio for SQL Server?