Search code examples
sqloracle-databaserdbms

Should I put data types in column names?


I've recently joined a project where our DBA has us including the data type at the end of the column name. For instance date_of_birth_datetime or amount_refunded_decimal. To me this just feels wrong, but I can't seem to come up with a good reason to try and persuade him to abandon this convention. The only reason I can come up with is that it takes up 5-10 characters to include this data type which can be used to create more meaningful column names. Can anyone help me out, or is this a good practice and I need to correct my way of thinking? If so, why?


Solution

  • The DBA is including this for troubleshooting purposes should there be anything to come up later down the road instead of just looking in SSMS details. Seems to me this is not a good practice especially if your applications on beyond the intranet... giving a hacker another tool set easily to get into the system as an example.

    I personally would not include the datatype in my SQL DB's. http://searchsqlserver.techtarget.com/tip/Creating-SQL-Server-columns-A-best-practices-guide