Click or drag to resize

SA0244 : Database object created,altered or dropped without specifiying schema name

The topic describes the SA0244 analysis rule.

Message

Database object created,altered or dropped without specifiying schema name

Description

The rule checks T-SQL code for CREATE,ALTER and DROP statements of schema bound objects, which miss the schema name of the object.

It is recommended to fully qualify the target object name in CREATE,ALTER and DROP statements.

When not schema name is specified, the default schema of the current user is assumed.

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 TABLE Test.Greeting
 2(
 3GreetingId INT IDENTITY (1,1) PRIMARY KEY,
 4Message nvarchar(255) NOT NULL,
 5)
 6
 7CREATE TABLE Greeting
 8(
 9GreetingId INT IDENTITY (1,1) PRIMARY KEY,
10Message nvarchar(255) NOT NULL,
11)
12DROP TABLE greeting;
13
14DROP TABLE #tempTable1;

Analysis Results

 MessageLineColumn
1SA0244 : The table is created without specifiying schema name.713
2SA0244 : The table is dropped without specifiying schema name.1211
See Also

Other Resources