APX1088 – Parameters names not specified explicitly
Description:
This rule evaluates the T-SQL script for executing a stored procedure without referencing parameters explicitly by name.
Although it is possible, it is considered a best practice to provide the names of the parameters.
For more information visit
Example script:
1 2 3 4 5 6 7 8 |
EXEC proc_ListAllParam 12345, 54321, 32145; EXEC proc_ListAllParam @FirstNumeber = 12345, @SecondNumeber = 54321, @ThirdNumeber = 32145; |
Message:
Explicitly named parameters not used when calling procedure,proc_ListAllParam
APX1110 – Special chars in name
Description:
This rule evaluates the T-SQL script for using special characters in identifiers.
Try to avoid using special characters in the identifiers.
For more information visit
Example script:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
CREATE TABLE [dbo].[TableSpecCharFirstFailedEx] ([ID] INT NOT NULL IDENTITY(0, 1), [First'Last] VARCHAR(30) -- contains special characters ( ' ) ); CREATE TABLE [dbo].[ TableSpecCharSecondFailedEx] ([ID] INT NOT NULL IDENTITY(0, 1), [First"Last] VARCHAR(30) -- contains special characters ( " ) ); CREATE TABLE [dbo].[ TableSpecCharThirdFailedEx] ([ID] INT NOT NULL IDENTITY(0, 1), [First Last] VARCHAR(30) -- contains special characters ( space ) ); CREATE TABLE [dbo].[ TableSpecCharFourthFailedEx] ([ID] INT NOT NULL IDENTITY(0, 1), [First Last] VARCHAR(30) -- contains special characters ( tab ) ); CREATE TABLE [dbo].[ TableSpecCharFifthFailedEx] ([ID] INT NOT NULL IDENTITY(0, 1), [First[Last] VARCHAR(30) -- contains special characters ( square bracket ) ); CREATE TABLE [dbo].[ TableSpecCharSixthFailedEx] ([ID] INT NOT NULL IDENTITY(0, 1), [First]]Last] VARCHAR(10) -- contains special characters ( square bracket ) ); CREATE TABLE [dbo].[ TableSpecCharFirstGoodEx] ([ID] INT NOT NULL IDENTITY(0, 1), [FirstLast] VARCHAR(30) ); |
Message:
Special character detected in identifier, [First’Last]
APX1155 – Naming convention prefix
Description:
This rule evaluates the T-SQL script for using object type prefixes in object names. e.g. sp_, trg_, fn_ etc.
For more information visit
Example script:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
CREATE TABLE tbl_Logs (id INT IDENTITY(1, 1) NOT NULL, Message VARCHAR(250) NOT NULL, Login VARCHAR(30) NOT NULL DEFAULT SYSTEM_USER ); CREATE PROCEDURE sp_NameConvPrefFirstFailedEx AS BEGIN DECLARE @handle INT; EXEC sp_xml_preparedocument @handle OUTPUT; END; GO CREATE PROCEDURE sp_NameConvPrefSecondFailedEx AS BEGIN DECLARE @handle INT; DECLARE @xmlval VARCHAR(256); SET @xmlval = '<ROOT><resultset><title>ApexSQL Enforce Report</title></resultset></ROOT>'; EXEC sp_xml_preparedocument @handle OUTPUT, @xmlval; END; GO CREATE TABLE Logins (LoginName NVARCHAR(100) NOT NULL, Pass NVARCHAR(50) NOT NULL ); GO CREATE TRIGGER trg_PassAudit ON Logins FOR INSERT, UPDATE, DELETE AS EXEC PassLog; GO CREATE FUNCTION fn_Compute (@param INT ) RETURNS INT AS BEGIN DECLARE @id INT; SET @id = @param * 2; RETURN @id; END; GO CREATE TABLE FirstTable( id int, name varchar(100), val varchar(25)) ON [PRIMARY]; GO CREATE VIEW v_NameConvPrefFirstFailedEx (id, val, name) AS SELECT * FROM FirstTable GO |
Message:
Object type prefix, ‘*’, detected
- Best author award in 2021 - January 3, 2022
- Best author award in 2020 - January 5, 2021
- Best author award in 2019 - January 3, 2020