I was taught not to use the name Id
for the identity column of my tables, but lately I've just been using it anyways because it's simple, short, and very descriptive about what the data actually is.
I've seen people suggest prefixing Id
with the table name, but this just seems to make more work for the person writing the SQL queries (or the programmer if you're using an ORM like Entity Framework), particularly on longer table names such as CustomerProductId
or AgencyGroupAssignementId
One third-party vendor we hired to create something for us actually named all their identity columns Ident
just to avoid using Id
. At first I thought they did that because Id
was a keyword, but when I looked into it, I found that Id
isn't a keyword in SQL Server 2005, which is what we are using.
So why do people recommend not using the name Id
for an identity column?
Edit: To clarify, I am not asking which naming convention to use, or for arguments to use one naming convention over the other. I just want to know why it's recommended to not use Id
for the identity column name.
I'm a single programmer, not a dba, and to me the database is just a place to store my data. Since I usually build small apps, and typically use an ORM for data access, a common field name for the identity field is much easier to work with. I want to know what I am missing out on by doing this, and if there are any really good reasons for me not to do this.