Skip to content

Commit 812445b

Browse files
committed
Updated README, fixed formatting for Using Money data type check.
1 parent 02f1e7a commit 812445b

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ The settings are located in the project "[\SQL-Server-Assess\Development Applica
171171

172172
# Current High Check Id
173173

174-
## Next Check Id: 28
174+
## Next Check Id: 29
175175

176176
# Naming Conventions
177177

@@ -486,7 +486,7 @@ Being frugal with memory is important for large tables, not only to save space b
486486

487487

488488
## Using MONEY Data Type
489-
**Check Id:** [NONE YET]
489+
**Check Id:** 28
490490

491491
The MONEY data type confuses the storage of data values with their display, though it clearly suggests, by its name, the sort of data held. Use DECIMAL(19, 4) instead. It is proprietary to SQL Server.
492492

sp_Develop.sql

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,7 +2028,7 @@ AS
20282028
SELECT
20292029
@CheckId = 28
20302030
,@Priority = 1
2031-
,@FindingGroup = 'Data Type Conventions'
2031+
,@FindingGroup = 'Data Type Conventions'
20322032
,@Finding = 'Using MONEY data type'
20332033
,@URLAnchor = 'using-money-data-type';
20342034
/**********************************************************************************************************************/
@@ -2052,18 +2052,20 @@ AS
20522052
,Object_Id = O.object_id
20532053
,ObjectName = O.name + ''.'' + C.Name
20542054
,ObjectType = ''COLUMN''
2055-
,Details = N''Column ''+ C.Name + N'' uses the '' + UPPER(t.name) +N'' data type, which has limited precision and can lead to roundoff errors. Consider using Decimal(19.4) instead.''
2055+
,Details = N''This column uses the '' + UPPER(T.name) + N'' data type, which has limited precision and can lead to roundoff errors. Consider using DECIMAL(19, 4) instead.''
20562056
FROM
20572057
' + QUOTENAME(@DatabaseName) + N'.sys.objects AS O
20582058
INNER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.schemas AS S ON S.schema_id = O.schema_id
20592059
INNER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.columns AS C ON C.object_id = O.object_id
20602060
INNER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.types AS T on T.user_type_id = C.user_type_id
20612061
WHERE
2062-
t.name IN (''money'', ''smallmoney'');';
2062+
T.name IN (''money'', ''smallmoney'');';
20632063

20642064
EXEC sys.sp_executesql @stmt = @StringToExecute;
20652065
IF @Debug = 2 AND @StringToExecute IS NOT NULL PRINT @StringToExecute;
20662066
END;
2067+
2068+
20672069
-- SQL Prompt formatting on
20682070
/**********************************************************************************************************************
20692071
** ██████ ██  ██ ███████  ██████ ██  ██ ███████  ███████ ███  ██ ██████ 

0 commit comments

Comments
 (0)