SA0218 : The ‘::’ function calling syntax is deprecated

The topic describes the SA0218 analysis rule.

Message

The ‘::’ function calling syntax is deprecated

Description

The rule checks T-SQL code and reports usages of the deprecated built-in function calling syntax ‘::’.

The calling of system function using the ::funciton_name() syntax is now deprecated and can be replaced with sys.function_name().

Scope

The rule has a Batch scope and is applied only on the SQL script.

Parameters

Rule has no parameters.

Remarks

The rule does not need Analysis Context or SQL Connection.

Categories

Deprecated Features, Bugs

Additional Information
Example Test Script
SQL
1-- Deprecated syntax usage.
2SELECT * FROM ::fn_virtualfilestats(2,1) 
3
4-- Correct function call syntax.
5SELECT * FROM sys.fn_virtualfilestats(2,1)

Analysis Results

  Message Line Column
1 SA0218 : The ‘::’ function calling syntax is deprecated. 2 16
See Also

Other Resources