DF216: User defined-function name begins with ‘fn_’.
Last modified: September 16, 2024
The topic describes the DF216 T-SQL code analysis rule.
Category
NAMING CONVENTIONS
Message
User defined-function name begins with ‘fn_’.
Description
It is recommended to avoid using the ‘fn_’ prefix for user-defined function names, as this prefix is commonly reserved for system functions.
Noncompliant code example
CREATE FUNCTION dbo.fn_DemoFunction(@x INT)
RETURNS INT
AS
BEGIN
RETURN @x + @x
END
GO
Compliant solution
CREATE FUNCTION dbo.udf_DemoFunction(@x INT)
RETURNS INT
AS
BEGIN
RETURN @x + @x
END
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.