SQL Server列命名规范:为何不建议在列名中添加数据类型后缀?
Great question! I’ve seen this exact pattern pop up in some older legacy systems, so I totally get why you’re curious about why it never became a standard in SQL Server. Let’s break down the key reasons experts and the wider community avoid this approach:
Data types belong to schema metadata, not business-focused column names
Column names should first and foremost communicate business meaning, not technical implementation details. If you suffixRevenuewith_f(for float), you’re locking that column to a specific data type. But business needs change—maybe later you realize you need to switch todecimalto avoid floating-point precision errors. Changing the column name toRevenue_dwould force you to update every query, stored procedure, ETL script, and application that references it. That’s a massive maintenance headache that could’ve been avoided by keeping the name focused on the business value.SQL Server gives you better ways to check data types
You never need to guess a column’s data type from its name—SQL Server provides built-in tools to look this up directly. For example:-- Query column metadata SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'YourTableName'; -- Or use a system stored procedure EXEC sp_help 'YourTableName';These methods are far more reliable than parsing suffixes, and they work for every table in your database without relying on a consistent naming pattern.
It violates the "Principle of Least Surprise"
When developers see a column name likeOrganization_vorAccountNumber_i, their first question is usually "What does that suffix mean?" instead of immediately understanding the column’s purpose. Good naming should be intuitive—AccountNumbertells you everything you need to know about the data it holds at a glance, without forcing you to decode a suffix.Community and official best practices discourage it
Microsoft’s official SQL Server naming guidelines, along with widely accepted industry best practices, emphasize using descriptive, business-aligned names for columns. The focus is on making your schema readable and maintainable for other developers, not embedding technical metadata in names. Even ORMs like Entity Framework automatically map SQL data types to .NET types, so developers rarely need to reference the column’s data type directly in day-to-day work.
That said, you might occasionally see this pattern in temporary tables or data warehouse staging layers where quick, ad-hoc work is happening—but it’s almost never used in production business tables for the reasons above.
内容的提问来源于stack exchange,提问作者Chester Lim




