Click or drag to resize

SA0260 : Parameter defined as nullable, but no default value provided

The topic describes the SA0260 analysis rule.

Message

Parameter defined as nullable, but no default value provided

Description

The rule checks T-SQL code for procedures and functions parameters, which are defined as null-able, but have no default value provided.

Even defined as null-able, such parameters, which don’t have a default value, will still require a value when the procedure or function is invoked.

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

Design Rules, New Rules

Additional Information

There is no additional info for this rule.

Example Test Script
SQL
 1CREATE PROCEDURE SA00256.TestProc
 2  @param1 int 
 3, @param2 int NULL
 4, @param3 int NULL = NULL
 5, @param4 int = NULL
 6AS
 7BEGIN
 8    SET NOCOUNT ON;
 9        /* PROCEDURE BODY */
10END

Analysis Results

 MessageLineColumn
1SA0260 : Parameter defined as nullable, but no default value provided.32
See Also

Other Resources